1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/securityhub/SecurityHub_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/core/utils/memory/stl/AWSVector.h>
10 #include <aws/securityhub/model/VulnerabilityVendor.h>
11 #include <aws/securityhub/model/SoftwarePackage.h>
12 #include <aws/securityhub/model/Cvss.h>
13 #include <utility>
14 
15 namespace Aws
16 {
17 namespace Utils
18 {
19 namespace Json
20 {
21   class JsonValue;
22   class JsonView;
23 } // namespace Json
24 } // namespace Utils
25 namespace SecurityHub
26 {
27 namespace Model
28 {
29 
30   /**
31    * <p>A vulnerability associated with a finding.</p><p><h3>See Also:</h3>   <a
32    * href="http://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/Vulnerability">AWS
33    * API Reference</a></p>
34    */
35   class AWS_SECURITYHUB_API Vulnerability
36   {
37   public:
38     Vulnerability();
39     Vulnerability(Aws::Utils::Json::JsonView jsonValue);
40     Vulnerability& operator=(Aws::Utils::Json::JsonView jsonValue);
41     Aws::Utils::Json::JsonValue Jsonize() const;
42 
43 
44     /**
45      * <p>The identifier of the vulnerability.</p>
46      */
GetId()47     inline const Aws::String& GetId() const{ return m_id; }
48 
49     /**
50      * <p>The identifier of the vulnerability.</p>
51      */
IdHasBeenSet()52     inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
53 
54     /**
55      * <p>The identifier of the vulnerability.</p>
56      */
SetId(const Aws::String & value)57     inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
58 
59     /**
60      * <p>The identifier of the vulnerability.</p>
61      */
SetId(Aws::String && value)62     inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
63 
64     /**
65      * <p>The identifier of the vulnerability.</p>
66      */
SetId(const char * value)67     inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
68 
69     /**
70      * <p>The identifier of the vulnerability.</p>
71      */
WithId(const Aws::String & value)72     inline Vulnerability& WithId(const Aws::String& value) { SetId(value); return *this;}
73 
74     /**
75      * <p>The identifier of the vulnerability.</p>
76      */
WithId(Aws::String && value)77     inline Vulnerability& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
78 
79     /**
80      * <p>The identifier of the vulnerability.</p>
81      */
WithId(const char * value)82     inline Vulnerability& WithId(const char* value) { SetId(value); return *this;}
83 
84 
85     /**
86      * <p>List of software packages that have the vulnerability.</p>
87      */
GetVulnerablePackages()88     inline const Aws::Vector<SoftwarePackage>& GetVulnerablePackages() const{ return m_vulnerablePackages; }
89 
90     /**
91      * <p>List of software packages that have the vulnerability.</p>
92      */
VulnerablePackagesHasBeenSet()93     inline bool VulnerablePackagesHasBeenSet() const { return m_vulnerablePackagesHasBeenSet; }
94 
95     /**
96      * <p>List of software packages that have the vulnerability.</p>
97      */
SetVulnerablePackages(const Aws::Vector<SoftwarePackage> & value)98     inline void SetVulnerablePackages(const Aws::Vector<SoftwarePackage>& value) { m_vulnerablePackagesHasBeenSet = true; m_vulnerablePackages = value; }
99 
100     /**
101      * <p>List of software packages that have the vulnerability.</p>
102      */
SetVulnerablePackages(Aws::Vector<SoftwarePackage> && value)103     inline void SetVulnerablePackages(Aws::Vector<SoftwarePackage>&& value) { m_vulnerablePackagesHasBeenSet = true; m_vulnerablePackages = std::move(value); }
104 
105     /**
106      * <p>List of software packages that have the vulnerability.</p>
107      */
WithVulnerablePackages(const Aws::Vector<SoftwarePackage> & value)108     inline Vulnerability& WithVulnerablePackages(const Aws::Vector<SoftwarePackage>& value) { SetVulnerablePackages(value); return *this;}
109 
110     /**
111      * <p>List of software packages that have the vulnerability.</p>
112      */
WithVulnerablePackages(Aws::Vector<SoftwarePackage> && value)113     inline Vulnerability& WithVulnerablePackages(Aws::Vector<SoftwarePackage>&& value) { SetVulnerablePackages(std::move(value)); return *this;}
114 
115     /**
116      * <p>List of software packages that have the vulnerability.</p>
117      */
AddVulnerablePackages(const SoftwarePackage & value)118     inline Vulnerability& AddVulnerablePackages(const SoftwarePackage& value) { m_vulnerablePackagesHasBeenSet = true; m_vulnerablePackages.push_back(value); return *this; }
119 
120     /**
121      * <p>List of software packages that have the vulnerability.</p>
122      */
AddVulnerablePackages(SoftwarePackage && value)123     inline Vulnerability& AddVulnerablePackages(SoftwarePackage&& value) { m_vulnerablePackagesHasBeenSet = true; m_vulnerablePackages.push_back(std::move(value)); return *this; }
124 
125 
126     /**
127      * <p>CVSS scores from the advisory related to the vulnerability.</p>
128      */
GetCvss()129     inline const Aws::Vector<Cvss>& GetCvss() const{ return m_cvss; }
130 
131     /**
132      * <p>CVSS scores from the advisory related to the vulnerability.</p>
133      */
CvssHasBeenSet()134     inline bool CvssHasBeenSet() const { return m_cvssHasBeenSet; }
135 
136     /**
137      * <p>CVSS scores from the advisory related to the vulnerability.</p>
138      */
SetCvss(const Aws::Vector<Cvss> & value)139     inline void SetCvss(const Aws::Vector<Cvss>& value) { m_cvssHasBeenSet = true; m_cvss = value; }
140 
141     /**
142      * <p>CVSS scores from the advisory related to the vulnerability.</p>
143      */
SetCvss(Aws::Vector<Cvss> && value)144     inline void SetCvss(Aws::Vector<Cvss>&& value) { m_cvssHasBeenSet = true; m_cvss = std::move(value); }
145 
146     /**
147      * <p>CVSS scores from the advisory related to the vulnerability.</p>
148      */
WithCvss(const Aws::Vector<Cvss> & value)149     inline Vulnerability& WithCvss(const Aws::Vector<Cvss>& value) { SetCvss(value); return *this;}
150 
151     /**
152      * <p>CVSS scores from the advisory related to the vulnerability.</p>
153      */
WithCvss(Aws::Vector<Cvss> && value)154     inline Vulnerability& WithCvss(Aws::Vector<Cvss>&& value) { SetCvss(std::move(value)); return *this;}
155 
156     /**
157      * <p>CVSS scores from the advisory related to the vulnerability.</p>
158      */
AddCvss(const Cvss & value)159     inline Vulnerability& AddCvss(const Cvss& value) { m_cvssHasBeenSet = true; m_cvss.push_back(value); return *this; }
160 
161     /**
162      * <p>CVSS scores from the advisory related to the vulnerability.</p>
163      */
AddCvss(Cvss && value)164     inline Vulnerability& AddCvss(Cvss&& value) { m_cvssHasBeenSet = true; m_cvss.push_back(std::move(value)); return *this; }
165 
166 
167     /**
168      * <p>List of vulnerabilities that are related to this vulnerability.</p>
169      */
GetRelatedVulnerabilities()170     inline const Aws::Vector<Aws::String>& GetRelatedVulnerabilities() const{ return m_relatedVulnerabilities; }
171 
172     /**
173      * <p>List of vulnerabilities that are related to this vulnerability.</p>
174      */
RelatedVulnerabilitiesHasBeenSet()175     inline bool RelatedVulnerabilitiesHasBeenSet() const { return m_relatedVulnerabilitiesHasBeenSet; }
176 
177     /**
178      * <p>List of vulnerabilities that are related to this vulnerability.</p>
179      */
SetRelatedVulnerabilities(const Aws::Vector<Aws::String> & value)180     inline void SetRelatedVulnerabilities(const Aws::Vector<Aws::String>& value) { m_relatedVulnerabilitiesHasBeenSet = true; m_relatedVulnerabilities = value; }
181 
182     /**
183      * <p>List of vulnerabilities that are related to this vulnerability.</p>
184      */
SetRelatedVulnerabilities(Aws::Vector<Aws::String> && value)185     inline void SetRelatedVulnerabilities(Aws::Vector<Aws::String>&& value) { m_relatedVulnerabilitiesHasBeenSet = true; m_relatedVulnerabilities = std::move(value); }
186 
187     /**
188      * <p>List of vulnerabilities that are related to this vulnerability.</p>
189      */
WithRelatedVulnerabilities(const Aws::Vector<Aws::String> & value)190     inline Vulnerability& WithRelatedVulnerabilities(const Aws::Vector<Aws::String>& value) { SetRelatedVulnerabilities(value); return *this;}
191 
192     /**
193      * <p>List of vulnerabilities that are related to this vulnerability.</p>
194      */
WithRelatedVulnerabilities(Aws::Vector<Aws::String> && value)195     inline Vulnerability& WithRelatedVulnerabilities(Aws::Vector<Aws::String>&& value) { SetRelatedVulnerabilities(std::move(value)); return *this;}
196 
197     /**
198      * <p>List of vulnerabilities that are related to this vulnerability.</p>
199      */
AddRelatedVulnerabilities(const Aws::String & value)200     inline Vulnerability& AddRelatedVulnerabilities(const Aws::String& value) { m_relatedVulnerabilitiesHasBeenSet = true; m_relatedVulnerabilities.push_back(value); return *this; }
201 
202     /**
203      * <p>List of vulnerabilities that are related to this vulnerability.</p>
204      */
AddRelatedVulnerabilities(Aws::String && value)205     inline Vulnerability& AddRelatedVulnerabilities(Aws::String&& value) { m_relatedVulnerabilitiesHasBeenSet = true; m_relatedVulnerabilities.push_back(std::move(value)); return *this; }
206 
207     /**
208      * <p>List of vulnerabilities that are related to this vulnerability.</p>
209      */
AddRelatedVulnerabilities(const char * value)210     inline Vulnerability& AddRelatedVulnerabilities(const char* value) { m_relatedVulnerabilitiesHasBeenSet = true; m_relatedVulnerabilities.push_back(value); return *this; }
211 
212 
213     /**
214      * <p>Information about the vendor that generates the vulnerability report.</p>
215      */
GetVendor()216     inline const VulnerabilityVendor& GetVendor() const{ return m_vendor; }
217 
218     /**
219      * <p>Information about the vendor that generates the vulnerability report.</p>
220      */
VendorHasBeenSet()221     inline bool VendorHasBeenSet() const { return m_vendorHasBeenSet; }
222 
223     /**
224      * <p>Information about the vendor that generates the vulnerability report.</p>
225      */
SetVendor(const VulnerabilityVendor & value)226     inline void SetVendor(const VulnerabilityVendor& value) { m_vendorHasBeenSet = true; m_vendor = value; }
227 
228     /**
229      * <p>Information about the vendor that generates the vulnerability report.</p>
230      */
SetVendor(VulnerabilityVendor && value)231     inline void SetVendor(VulnerabilityVendor&& value) { m_vendorHasBeenSet = true; m_vendor = std::move(value); }
232 
233     /**
234      * <p>Information about the vendor that generates the vulnerability report.</p>
235      */
WithVendor(const VulnerabilityVendor & value)236     inline Vulnerability& WithVendor(const VulnerabilityVendor& value) { SetVendor(value); return *this;}
237 
238     /**
239      * <p>Information about the vendor that generates the vulnerability report.</p>
240      */
WithVendor(VulnerabilityVendor && value)241     inline Vulnerability& WithVendor(VulnerabilityVendor&& value) { SetVendor(std::move(value)); return *this;}
242 
243 
244     /**
245      * <p>A list of URLs that provide additional information about the
246      * vulnerability.</p>
247      */
GetReferenceUrls()248     inline const Aws::Vector<Aws::String>& GetReferenceUrls() const{ return m_referenceUrls; }
249 
250     /**
251      * <p>A list of URLs that provide additional information about the
252      * vulnerability.</p>
253      */
ReferenceUrlsHasBeenSet()254     inline bool ReferenceUrlsHasBeenSet() const { return m_referenceUrlsHasBeenSet; }
255 
256     /**
257      * <p>A list of URLs that provide additional information about the
258      * vulnerability.</p>
259      */
SetReferenceUrls(const Aws::Vector<Aws::String> & value)260     inline void SetReferenceUrls(const Aws::Vector<Aws::String>& value) { m_referenceUrlsHasBeenSet = true; m_referenceUrls = value; }
261 
262     /**
263      * <p>A list of URLs that provide additional information about the
264      * vulnerability.</p>
265      */
SetReferenceUrls(Aws::Vector<Aws::String> && value)266     inline void SetReferenceUrls(Aws::Vector<Aws::String>&& value) { m_referenceUrlsHasBeenSet = true; m_referenceUrls = std::move(value); }
267 
268     /**
269      * <p>A list of URLs that provide additional information about the
270      * vulnerability.</p>
271      */
WithReferenceUrls(const Aws::Vector<Aws::String> & value)272     inline Vulnerability& WithReferenceUrls(const Aws::Vector<Aws::String>& value) { SetReferenceUrls(value); return *this;}
273 
274     /**
275      * <p>A list of URLs that provide additional information about the
276      * vulnerability.</p>
277      */
WithReferenceUrls(Aws::Vector<Aws::String> && value)278     inline Vulnerability& WithReferenceUrls(Aws::Vector<Aws::String>&& value) { SetReferenceUrls(std::move(value)); return *this;}
279 
280     /**
281      * <p>A list of URLs that provide additional information about the
282      * vulnerability.</p>
283      */
AddReferenceUrls(const Aws::String & value)284     inline Vulnerability& AddReferenceUrls(const Aws::String& value) { m_referenceUrlsHasBeenSet = true; m_referenceUrls.push_back(value); return *this; }
285 
286     /**
287      * <p>A list of URLs that provide additional information about the
288      * vulnerability.</p>
289      */
AddReferenceUrls(Aws::String && value)290     inline Vulnerability& AddReferenceUrls(Aws::String&& value) { m_referenceUrlsHasBeenSet = true; m_referenceUrls.push_back(std::move(value)); return *this; }
291 
292     /**
293      * <p>A list of URLs that provide additional information about the
294      * vulnerability.</p>
295      */
AddReferenceUrls(const char * value)296     inline Vulnerability& AddReferenceUrls(const char* value) { m_referenceUrlsHasBeenSet = true; m_referenceUrls.push_back(value); return *this; }
297 
298   private:
299 
300     Aws::String m_id;
301     bool m_idHasBeenSet;
302 
303     Aws::Vector<SoftwarePackage> m_vulnerablePackages;
304     bool m_vulnerablePackagesHasBeenSet;
305 
306     Aws::Vector<Cvss> m_cvss;
307     bool m_cvssHasBeenSet;
308 
309     Aws::Vector<Aws::String> m_relatedVulnerabilities;
310     bool m_relatedVulnerabilitiesHasBeenSet;
311 
312     VulnerabilityVendor m_vendor;
313     bool m_vendorHasBeenSet;
314 
315     Aws::Vector<Aws::String> m_referenceUrls;
316     bool m_referenceUrlsHasBeenSet;
317   };
318 
319 } // namespace Model
320 } // namespace SecurityHub
321 } // namespace Aws
322