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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>This object typically provides details about a control finding, such as applicable standards and the status of control checks. While finding providers can add custom content in <code>Compliance</code> object fields, they are typically used to review details of Security Hub CSPM control findings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Compliance {
/// <p>Typically summarizes the result of a control check.</p>
/// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
/// <ul>
/// <li>
/// <ul>
/// <li>
/// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
/// <li>
/// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
/// <li>
/// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
/// <li>
/// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
/// </ul></li>
/// </ul>
pub status: ::std::option::Option<crate::types::ComplianceStatus>,
/// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
/// <p>Array Members: Maximum number of 32 items.</p>
pub related_requirements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
pub status_reasons: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>,
/// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
pub security_control_id: ::std::option::Option<::std::string::String>,
/// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
pub associated_standards: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>,
/// <p>Typically an object that includes security control parameter names and values.</p>
pub security_control_parameters: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>,
}
impl Compliance {
/// <p>Typically summarizes the result of a control check.</p>
/// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
/// <ul>
/// <li>
/// <ul>
/// <li>
/// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
/// <li>
/// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
/// <li>
/// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
/// <li>
/// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
/// </ul></li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&crate::types::ComplianceStatus> {
self.status.as_ref()
}
/// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
/// <p>Array Members: Maximum number of 32 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 `.related_requirements.is_none()`.
pub fn related_requirements(&self) -> &[::std::string::String] {
self.related_requirements.as_deref().unwrap_or_default()
}
/// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</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 `.status_reasons.is_none()`.
pub fn status_reasons(&self) -> &[crate::types::StatusReason] {
self.status_reasons.as_deref().unwrap_or_default()
}
/// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
pub fn security_control_id(&self) -> ::std::option::Option<&str> {
self.security_control_id.as_deref()
}
/// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</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 `.associated_standards.is_none()`.
pub fn associated_standards(&self) -> &[crate::types::AssociatedStandard] {
self.associated_standards.as_deref().unwrap_or_default()
}
/// <p>Typically an object that includes security control parameter names and values.</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 `.security_control_parameters.is_none()`.
pub fn security_control_parameters(&self) -> &[crate::types::SecurityControlParameter] {
self.security_control_parameters.as_deref().unwrap_or_default()
}
}
impl Compliance {
/// Creates a new builder-style object to manufacture [`Compliance`](crate::types::Compliance).
pub fn builder() -> crate::types::builders::ComplianceBuilder {
crate::types::builders::ComplianceBuilder::default()
}
}
/// A builder for [`Compliance`](crate::types::Compliance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ComplianceBuilder {
pub(crate) status: ::std::option::Option<crate::types::ComplianceStatus>,
pub(crate) related_requirements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) status_reasons: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>,
pub(crate) security_control_id: ::std::option::Option<::std::string::String>,
pub(crate) associated_standards: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>,
pub(crate) security_control_parameters: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>,
}
impl ComplianceBuilder {
/// <p>Typically summarizes the result of a control check.</p>
/// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
/// <ul>
/// <li>
/// <ul>
/// <li>
/// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
/// <li>
/// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
/// <li>
/// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
/// <li>
/// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
/// </ul></li>
/// </ul>
pub fn status(mut self, input: crate::types::ComplianceStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>Typically summarizes the result of a control check.</p>
/// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
/// <ul>
/// <li>
/// <ul>
/// <li>
/// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
/// <li>
/// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
/// <li>
/// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
/// <li>
/// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
/// </ul></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ComplianceStatus>) -> Self {
self.status = input;
self
}
/// <p>Typically summarizes the result of a control check.</p>
/// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
/// <ul>
/// <li>
/// <ul>
/// <li>
/// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
/// <li>
/// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
/// <li>
/// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
/// <li>
/// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
/// </ul></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<crate::types::ComplianceStatus> {
&self.status
}
/// Appends an item to `related_requirements`.
///
/// To override the contents of this collection use [`set_related_requirements`](Self::set_related_requirements).
///
/// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
/// <p>Array Members: Maximum number of 32 items.</p>
pub fn related_requirements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.related_requirements.unwrap_or_default();
v.push(input.into());
self.related_requirements = ::std::option::Option::Some(v);
self
}
/// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
/// <p>Array Members: Maximum number of 32 items.</p>
pub fn set_related_requirements(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.related_requirements = input;
self
}
/// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
/// <p>Array Members: Maximum number of 32 items.</p>
pub fn get_related_requirements(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.related_requirements
}
/// Appends an item to `status_reasons`.
///
/// To override the contents of this collection use [`set_status_reasons`](Self::set_status_reasons).
///
/// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
pub fn status_reasons(mut self, input: crate::types::StatusReason) -> Self {
let mut v = self.status_reasons.unwrap_or_default();
v.push(input);
self.status_reasons = ::std::option::Option::Some(v);
self
}
/// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
pub fn set_status_reasons(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>) -> Self {
self.status_reasons = input;
self
}
/// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
pub fn get_status_reasons(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StatusReason>> {
&self.status_reasons
}
/// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
pub fn security_control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.security_control_id = ::std::option::Option::Some(input.into());
self
}
/// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
pub fn set_security_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.security_control_id = input;
self
}
/// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
pub fn get_security_control_id(&self) -> &::std::option::Option<::std::string::String> {
&self.security_control_id
}
/// Appends an item to `associated_standards`.
///
/// To override the contents of this collection use [`set_associated_standards`](Self::set_associated_standards).
///
/// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
pub fn associated_standards(mut self, input: crate::types::AssociatedStandard) -> Self {
let mut v = self.associated_standards.unwrap_or_default();
v.push(input);
self.associated_standards = ::std::option::Option::Some(v);
self
}
/// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
pub fn set_associated_standards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>) -> Self {
self.associated_standards = input;
self
}
/// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
pub fn get_associated_standards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>> {
&self.associated_standards
}
/// Appends an item to `security_control_parameters`.
///
/// To override the contents of this collection use [`set_security_control_parameters`](Self::set_security_control_parameters).
///
/// <p>Typically an object that includes security control parameter names and values.</p>
pub fn security_control_parameters(mut self, input: crate::types::SecurityControlParameter) -> Self {
let mut v = self.security_control_parameters.unwrap_or_default();
v.push(input);
self.security_control_parameters = ::std::option::Option::Some(v);
self
}
/// <p>Typically an object that includes security control parameter names and values.</p>
pub fn set_security_control_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>) -> Self {
self.security_control_parameters = input;
self
}
/// <p>Typically an object that includes security control parameter names and values.</p>
pub fn get_security_control_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>> {
&self.security_control_parameters
}
/// Consumes the builder and constructs a [`Compliance`](crate::types::Compliance).
pub fn build(self) -> crate::types::Compliance {
crate::types::Compliance {
status: self.status,
related_requirements: self.related_requirements,
status_reasons: self.status_reasons,
security_control_id: self.security_control_id,
associated_standards: self.associated_standards,
security_control_parameters: self.security_control_parameters,
}
}
}