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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Information about a security vulnerability that Amazon CodeGuru Security detected.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Vulnerability {
/// <p>One or more URL addresses that contain details about a vulnerability.</p>
pub reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
pub related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The identifier for the vulnerability.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>An object that describes the location of the detected security vulnerability in your code.</p>
pub file_path: ::std::option::Option<crate::types::FilePath>,
/// <p>The number of times the vulnerability appears in your code.</p>
#[deprecated(note = "This shape is not used.")]
pub item_count: ::std::option::Option<i32>,
}
impl Vulnerability {
/// <p>One or more URL addresses that contain details about a vulnerability.</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 `.reference_urls.is_none()`.
pub fn reference_urls(&self) -> &[::std::string::String] {
self.reference_urls.as_deref().unwrap_or_default()
}
/// <p>One or more vulnerabilities that are related to the vulnerability being described.</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 `.related_vulnerabilities.is_none()`.
pub fn related_vulnerabilities(&self) -> &[::std::string::String] {
self.related_vulnerabilities.as_deref().unwrap_or_default()
}
/// <p>The identifier for the vulnerability.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>An object that describes the location of the detected security vulnerability in your code.</p>
pub fn file_path(&self) -> ::std::option::Option<&crate::types::FilePath> {
self.file_path.as_ref()
}
/// <p>The number of times the vulnerability appears in your code.</p>
#[deprecated(note = "This shape is not used.")]
pub fn item_count(&self) -> ::std::option::Option<i32> {
self.item_count
}
}
impl Vulnerability {
/// Creates a new builder-style object to manufacture [`Vulnerability`](crate::types::Vulnerability).
pub fn builder() -> crate::types::builders::VulnerabilityBuilder {
crate::types::builders::VulnerabilityBuilder::default()
}
}
/// A builder for [`Vulnerability`](crate::types::Vulnerability).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VulnerabilityBuilder {
pub(crate) reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) file_path: ::std::option::Option<crate::types::FilePath>,
pub(crate) item_count: ::std::option::Option<i32>,
}
impl VulnerabilityBuilder {
/// Appends an item to `reference_urls`.
///
/// To override the contents of this collection use [`set_reference_urls`](Self::set_reference_urls).
///
/// <p>One or more URL addresses that contain details about a vulnerability.</p>
pub fn reference_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.reference_urls.unwrap_or_default();
v.push(input.into());
self.reference_urls = ::std::option::Option::Some(v);
self
}
/// <p>One or more URL addresses that contain details about a vulnerability.</p>
pub fn set_reference_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.reference_urls = input;
self
}
/// <p>One or more URL addresses that contain details about a vulnerability.</p>
pub fn get_reference_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.reference_urls
}
/// Appends an item to `related_vulnerabilities`.
///
/// To override the contents of this collection use [`set_related_vulnerabilities`](Self::set_related_vulnerabilities).
///
/// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
pub fn related_vulnerabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.related_vulnerabilities.unwrap_or_default();
v.push(input.into());
self.related_vulnerabilities = ::std::option::Option::Some(v);
self
}
/// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
pub fn set_related_vulnerabilities(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.related_vulnerabilities = input;
self
}
/// <p>One or more vulnerabilities that are related to the vulnerability being described.</p>
pub fn get_related_vulnerabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.related_vulnerabilities
}
/// <p>The identifier for the vulnerability.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier for the vulnerability.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The identifier for the vulnerability.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>An object that describes the location of the detected security vulnerability in your code.</p>
pub fn file_path(mut self, input: crate::types::FilePath) -> Self {
self.file_path = ::std::option::Option::Some(input);
self
}
/// <p>An object that describes the location of the detected security vulnerability in your code.</p>
pub fn set_file_path(mut self, input: ::std::option::Option<crate::types::FilePath>) -> Self {
self.file_path = input;
self
}
/// <p>An object that describes the location of the detected security vulnerability in your code.</p>
pub fn get_file_path(&self) -> &::std::option::Option<crate::types::FilePath> {
&self.file_path
}
/// <p>The number of times the vulnerability appears in your code.</p>
#[deprecated(note = "This shape is not used.")]
pub fn item_count(mut self, input: i32) -> Self {
self.item_count = ::std::option::Option::Some(input);
self
}
/// <p>The number of times the vulnerability appears in your code.</p>
#[deprecated(note = "This shape is not used.")]
pub fn set_item_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.item_count = input;
self
}
/// <p>The number of times the vulnerability appears in your code.</p>
#[deprecated(note = "This shape is not used.")]
pub fn get_item_count(&self) -> &::std::option::Option<i32> {
&self.item_count
}
/// Consumes the builder and constructs a [`Vulnerability`](crate::types::Vulnerability).
pub fn build(self) -> crate::types::Vulnerability {
crate::types::Vulnerability {
reference_urls: self.reference_urls,
related_vulnerabilities: self.related_vulnerabilities,
id: self.id,
file_path: self.file_path,
item_count: self.item_count,
}
}
}