Skip to main content

aws_sdk_imagebuilder/types/
_vulnerable_package.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about a vulnerable package that Amazon Inspector identifies in a finding.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VulnerablePackage {
7    /// <p>The name of the vulnerable package.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>The version of the vulnerable package.</p>
10    pub version: ::std::option::Option<::std::string::String>,
11    /// <p>The source layer hash of the vulnerable package.</p>
12    pub source_layer_hash: ::std::option::Option<::std::string::String>,
13    /// <p>The epoch of the vulnerable package.</p>
14    pub epoch: ::std::option::Option<i32>,
15    /// <p>The release of the vulnerable package.</p>
16    pub release: ::std::option::Option<::std::string::String>,
17    /// <p>The architecture of the vulnerable package.</p>
18    pub arch: ::std::option::Option<::std::string::String>,
19    /// <p>The package manager of the vulnerable package.</p>
20    pub package_manager: ::std::option::Option<::std::string::String>,
21    /// <p>The file path of the vulnerable package.</p>
22    pub file_path: ::std::option::Option<::std::string::String>,
23    /// <p>The version of the package that contains the vulnerability fix.</p>
24    pub fixed_in_version: ::std::option::Option<::std::string::String>,
25    /// <p>The code to run in your environment to update packages with a fix available.</p>
26    pub remediation: ::std::option::Option<::std::string::String>,
27}
28impl VulnerablePackage {
29    /// <p>The name of the vulnerable package.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>The version of the vulnerable package.</p>
34    pub fn version(&self) -> ::std::option::Option<&str> {
35        self.version.as_deref()
36    }
37    /// <p>The source layer hash of the vulnerable package.</p>
38    pub fn source_layer_hash(&self) -> ::std::option::Option<&str> {
39        self.source_layer_hash.as_deref()
40    }
41    /// <p>The epoch of the vulnerable package.</p>
42    pub fn epoch(&self) -> ::std::option::Option<i32> {
43        self.epoch
44    }
45    /// <p>The release of the vulnerable package.</p>
46    pub fn release(&self) -> ::std::option::Option<&str> {
47        self.release.as_deref()
48    }
49    /// <p>The architecture of the vulnerable package.</p>
50    pub fn arch(&self) -> ::std::option::Option<&str> {
51        self.arch.as_deref()
52    }
53    /// <p>The package manager of the vulnerable package.</p>
54    pub fn package_manager(&self) -> ::std::option::Option<&str> {
55        self.package_manager.as_deref()
56    }
57    /// <p>The file path of the vulnerable package.</p>
58    pub fn file_path(&self) -> ::std::option::Option<&str> {
59        self.file_path.as_deref()
60    }
61    /// <p>The version of the package that contains the vulnerability fix.</p>
62    pub fn fixed_in_version(&self) -> ::std::option::Option<&str> {
63        self.fixed_in_version.as_deref()
64    }
65    /// <p>The code to run in your environment to update packages with a fix available.</p>
66    pub fn remediation(&self) -> ::std::option::Option<&str> {
67        self.remediation.as_deref()
68    }
69}
70impl VulnerablePackage {
71    /// Creates a new builder-style object to manufacture [`VulnerablePackage`](crate::types::VulnerablePackage).
72    pub fn builder() -> crate::types::builders::VulnerablePackageBuilder {
73        crate::types::builders::VulnerablePackageBuilder::default()
74    }
75}
76
77/// A builder for [`VulnerablePackage`](crate::types::VulnerablePackage).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct VulnerablePackageBuilder {
81    pub(crate) name: ::std::option::Option<::std::string::String>,
82    pub(crate) version: ::std::option::Option<::std::string::String>,
83    pub(crate) source_layer_hash: ::std::option::Option<::std::string::String>,
84    pub(crate) epoch: ::std::option::Option<i32>,
85    pub(crate) release: ::std::option::Option<::std::string::String>,
86    pub(crate) arch: ::std::option::Option<::std::string::String>,
87    pub(crate) package_manager: ::std::option::Option<::std::string::String>,
88    pub(crate) file_path: ::std::option::Option<::std::string::String>,
89    pub(crate) fixed_in_version: ::std::option::Option<::std::string::String>,
90    pub(crate) remediation: ::std::option::Option<::std::string::String>,
91}
92impl VulnerablePackageBuilder {
93    /// <p>The name of the vulnerable package.</p>
94    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.name = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The name of the vulnerable package.</p>
99    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.name = input;
101        self
102    }
103    /// <p>The name of the vulnerable package.</p>
104    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
105        &self.name
106    }
107    /// <p>The version of the vulnerable package.</p>
108    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.version = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The version of the vulnerable package.</p>
113    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.version = input;
115        self
116    }
117    /// <p>The version of the vulnerable package.</p>
118    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
119        &self.version
120    }
121    /// <p>The source layer hash of the vulnerable package.</p>
122    pub fn source_layer_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.source_layer_hash = ::std::option::Option::Some(input.into());
124        self
125    }
126    /// <p>The source layer hash of the vulnerable package.</p>
127    pub fn set_source_layer_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.source_layer_hash = input;
129        self
130    }
131    /// <p>The source layer hash of the vulnerable package.</p>
132    pub fn get_source_layer_hash(&self) -> &::std::option::Option<::std::string::String> {
133        &self.source_layer_hash
134    }
135    /// <p>The epoch of the vulnerable package.</p>
136    pub fn epoch(mut self, input: i32) -> Self {
137        self.epoch = ::std::option::Option::Some(input);
138        self
139    }
140    /// <p>The epoch of the vulnerable package.</p>
141    pub fn set_epoch(mut self, input: ::std::option::Option<i32>) -> Self {
142        self.epoch = input;
143        self
144    }
145    /// <p>The epoch of the vulnerable package.</p>
146    pub fn get_epoch(&self) -> &::std::option::Option<i32> {
147        &self.epoch
148    }
149    /// <p>The release of the vulnerable package.</p>
150    pub fn release(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.release = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The release of the vulnerable package.</p>
155    pub fn set_release(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.release = input;
157        self
158    }
159    /// <p>The release of the vulnerable package.</p>
160    pub fn get_release(&self) -> &::std::option::Option<::std::string::String> {
161        &self.release
162    }
163    /// <p>The architecture of the vulnerable package.</p>
164    pub fn arch(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.arch = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The architecture of the vulnerable package.</p>
169    pub fn set_arch(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.arch = input;
171        self
172    }
173    /// <p>The architecture of the vulnerable package.</p>
174    pub fn get_arch(&self) -> &::std::option::Option<::std::string::String> {
175        &self.arch
176    }
177    /// <p>The package manager of the vulnerable package.</p>
178    pub fn package_manager(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.package_manager = ::std::option::Option::Some(input.into());
180        self
181    }
182    /// <p>The package manager of the vulnerable package.</p>
183    pub fn set_package_manager(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.package_manager = input;
185        self
186    }
187    /// <p>The package manager of the vulnerable package.</p>
188    pub fn get_package_manager(&self) -> &::std::option::Option<::std::string::String> {
189        &self.package_manager
190    }
191    /// <p>The file path of the vulnerable package.</p>
192    pub fn file_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.file_path = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <p>The file path of the vulnerable package.</p>
197    pub fn set_file_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.file_path = input;
199        self
200    }
201    /// <p>The file path of the vulnerable package.</p>
202    pub fn get_file_path(&self) -> &::std::option::Option<::std::string::String> {
203        &self.file_path
204    }
205    /// <p>The version of the package that contains the vulnerability fix.</p>
206    pub fn fixed_in_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.fixed_in_version = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>The version of the package that contains the vulnerability fix.</p>
211    pub fn set_fixed_in_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.fixed_in_version = input;
213        self
214    }
215    /// <p>The version of the package that contains the vulnerability fix.</p>
216    pub fn get_fixed_in_version(&self) -> &::std::option::Option<::std::string::String> {
217        &self.fixed_in_version
218    }
219    /// <p>The code to run in your environment to update packages with a fix available.</p>
220    pub fn remediation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.remediation = ::std::option::Option::Some(input.into());
222        self
223    }
224    /// <p>The code to run in your environment to update packages with a fix available.</p>
225    pub fn set_remediation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.remediation = input;
227        self
228    }
229    /// <p>The code to run in your environment to update packages with a fix available.</p>
230    pub fn get_remediation(&self) -> &::std::option::Option<::std::string::String> {
231        &self.remediation
232    }
233    /// Consumes the builder and constructs a [`VulnerablePackage`](crate::types::VulnerablePackage).
234    pub fn build(self) -> crate::types::VulnerablePackage {
235        crate::types::VulnerablePackage {
236            name: self.name,
237            version: self.version,
238            source_layer_hash: self.source_layer_hash,
239            epoch: self.epoch,
240            release: self.release,
241            arch: self.arch,
242            package_manager: self.package_manager,
243            file_path: self.file_path,
244            fixed_in_version: self.fixed_in_version,
245            remediation: self.remediation,
246        }
247    }
248}