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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Output of <code>GetControlStatus</code>: the effective status of one control in a project.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetControlStatusOutput {
/// <p>The identifier of the control.</p>
pub control_id: ::std::string::String,
/// <p>The identifier of the control group that contains the control. Absent when the control isn't in a control group.</p>
pub control_group_id: ::std::option::Option<::std::string::String>,
/// <p>The effective compliance status of the control. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>COMPLIANT</code> or <code>NEEDS_ATTENTION</code> – Based on the compliance percentage that the most recent assessment calculated.</p></li>
/// <li>
/// <p><code>NOT_APPLICABLE</code> – The control, or every one of its requirements, is not applicable to the project.</p></li>
/// <li>
/// <p><code>NOT_ASSESSED</code> – The most recent assessment hasn't finished, ended in an error, or found no outcome for any applicable requirement.</p></li>
/// </ul>
pub status: crate::types::ComplianceStatus,
/// <p>The compliance percentage that the most recent assessment of the control calculated. A decision that you declare after that assessment doesn't change this value. The next assessment calculates a new percentage. Absent when <code>status</code> is <code>NOT_ASSESSED</code> or <code>NOT_APPLICABLE</code>.</p>
pub outcome_percentage: ::std::option::Option<f64>,
/// <p>The number of the control's requirements that apply to the project.</p>
pub applicable_requirement_count: i32,
/// <p>The number of the control's requirements whose status is <code>not_applicable</code>. The count includes requirements that you declare not applicable, directly or through the control. It also includes requirements that the assessment determines don't apply.</p>
pub excluded_requirement_count: i32,
/// <p>The decision declared on the control itself. Absent when no decision is declared on the control. Decisions on individual requirements are returned in <code>requirementStatuses</code>.</p>
pub status_override: ::std::option::Option<crate::types::StatusOverride>,
/// <p>The identifier of the most recent assessment of the control in the project. Absent if no assessment has run for the control.</p>
pub last_assessment_id: ::std::option::Option<::std::string::String>,
/// <p>The time when the most recent assessment of the control was last updated.</p>
pub last_assessed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The state of the most recent assessment of the control.</p>
pub last_assessment_status: ::std::option::Option<crate::types::AssessmentStatus>,
/// <p>The effective status of each of the control's requirements, including requirements that are not applicable.</p>
pub requirement_statuses: ::std::vec::Vec<crate::types::RequirementStatus>,
_request_id: Option<String>,
}
impl GetControlStatusOutput {
/// <p>The identifier of the control.</p>
pub fn control_id(&self) -> &str {
use std::ops::Deref;
self.control_id.deref()
}
/// <p>The identifier of the control group that contains the control. Absent when the control isn't in a control group.</p>
pub fn control_group_id(&self) -> ::std::option::Option<&str> {
self.control_group_id.as_deref()
}
/// <p>The effective compliance status of the control. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>COMPLIANT</code> or <code>NEEDS_ATTENTION</code> – Based on the compliance percentage that the most recent assessment calculated.</p></li>
/// <li>
/// <p><code>NOT_APPLICABLE</code> – The control, or every one of its requirements, is not applicable to the project.</p></li>
/// <li>
/// <p><code>NOT_ASSESSED</code> – The most recent assessment hasn't finished, ended in an error, or found no outcome for any applicable requirement.</p></li>
/// </ul>
pub fn status(&self) -> &crate::types::ComplianceStatus {
&self.status
}
/// <p>The compliance percentage that the most recent assessment of the control calculated. A decision that you declare after that assessment doesn't change this value. The next assessment calculates a new percentage. Absent when <code>status</code> is <code>NOT_ASSESSED</code> or <code>NOT_APPLICABLE</code>.</p>
pub fn outcome_percentage(&self) -> ::std::option::Option<f64> {
self.outcome_percentage
}
/// <p>The number of the control's requirements that apply to the project.</p>
pub fn applicable_requirement_count(&self) -> i32 {
self.applicable_requirement_count
}
/// <p>The number of the control's requirements whose status is <code>not_applicable</code>. The count includes requirements that you declare not applicable, directly or through the control. It also includes requirements that the assessment determines don't apply.</p>
pub fn excluded_requirement_count(&self) -> i32 {
self.excluded_requirement_count
}
/// <p>The decision declared on the control itself. Absent when no decision is declared on the control. Decisions on individual requirements are returned in <code>requirementStatuses</code>.</p>
pub fn status_override(&self) -> ::std::option::Option<&crate::types::StatusOverride> {
self.status_override.as_ref()
}
/// <p>The identifier of the most recent assessment of the control in the project. Absent if no assessment has run for the control.</p>
pub fn last_assessment_id(&self) -> ::std::option::Option<&str> {
self.last_assessment_id.as_deref()
}
/// <p>The time when the most recent assessment of the control was last updated.</p>
pub fn last_assessed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_assessed_at.as_ref()
}
/// <p>The state of the most recent assessment of the control.</p>
pub fn last_assessment_status(&self) -> ::std::option::Option<&crate::types::AssessmentStatus> {
self.last_assessment_status.as_ref()
}
/// <p>The effective status of each of the control's requirements, including requirements that are not applicable.</p>
pub fn requirement_statuses(&self) -> &[crate::types::RequirementStatus] {
use std::ops::Deref;
self.requirement_statuses.deref()
}
}
impl ::aws_types::request_id::RequestId for GetControlStatusOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetControlStatusOutput {
/// Creates a new builder-style object to manufacture [`GetControlStatusOutput`](crate::operation::get_control_status::GetControlStatusOutput).
pub fn builder() -> crate::operation::get_control_status::builders::GetControlStatusOutputBuilder {
crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::default()
}
}
/// A builder for [`GetControlStatusOutput`](crate::operation::get_control_status::GetControlStatusOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetControlStatusOutputBuilder {
pub(crate) control_id: ::std::option::Option<::std::string::String>,
pub(crate) control_group_id: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::ComplianceStatus>,
pub(crate) outcome_percentage: ::std::option::Option<f64>,
pub(crate) applicable_requirement_count: ::std::option::Option<i32>,
pub(crate) excluded_requirement_count: ::std::option::Option<i32>,
pub(crate) status_override: ::std::option::Option<crate::types::StatusOverride>,
pub(crate) last_assessment_id: ::std::option::Option<::std::string::String>,
pub(crate) last_assessed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_assessment_status: ::std::option::Option<crate::types::AssessmentStatus>,
pub(crate) requirement_statuses: ::std::option::Option<::std::vec::Vec<crate::types::RequirementStatus>>,
_request_id: Option<String>,
}
impl GetControlStatusOutputBuilder {
/// <p>The identifier of the control.</p>
/// This field is required.
pub fn control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.control_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the control.</p>
pub fn set_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.control_id = input;
self
}
/// <p>The identifier of the control.</p>
pub fn get_control_id(&self) -> &::std::option::Option<::std::string::String> {
&self.control_id
}
/// <p>The identifier of the control group that contains the control. Absent when the control isn't in a control group.</p>
pub fn control_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.control_group_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the control group that contains the control. Absent when the control isn't in a control group.</p>
pub fn set_control_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.control_group_id = input;
self
}
/// <p>The identifier of the control group that contains the control. Absent when the control isn't in a control group.</p>
pub fn get_control_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.control_group_id
}
/// <p>The effective compliance status of the control. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>COMPLIANT</code> or <code>NEEDS_ATTENTION</code> – Based on the compliance percentage that the most recent assessment calculated.</p></li>
/// <li>
/// <p><code>NOT_APPLICABLE</code> – The control, or every one of its requirements, is not applicable to the project.</p></li>
/// <li>
/// <p><code>NOT_ASSESSED</code> – The most recent assessment hasn't finished, ended in an error, or found no outcome for any applicable requirement.</p></li>
/// </ul>
/// This field is required.
pub fn status(mut self, input: crate::types::ComplianceStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The effective compliance status of the control. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>COMPLIANT</code> or <code>NEEDS_ATTENTION</code> – Based on the compliance percentage that the most recent assessment calculated.</p></li>
/// <li>
/// <p><code>NOT_APPLICABLE</code> – The control, or every one of its requirements, is not applicable to the project.</p></li>
/// <li>
/// <p><code>NOT_ASSESSED</code> – The most recent assessment hasn't finished, ended in an error, or found no outcome for any applicable requirement.</p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ComplianceStatus>) -> Self {
self.status = input;
self
}
/// <p>The effective compliance status of the control. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>COMPLIANT</code> or <code>NEEDS_ATTENTION</code> – Based on the compliance percentage that the most recent assessment calculated.</p></li>
/// <li>
/// <p><code>NOT_APPLICABLE</code> – The control, or every one of its requirements, is not applicable to the project.</p></li>
/// <li>
/// <p><code>NOT_ASSESSED</code> – The most recent assessment hasn't finished, ended in an error, or found no outcome for any applicable requirement.</p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<crate::types::ComplianceStatus> {
&self.status
}
/// <p>The compliance percentage that the most recent assessment of the control calculated. A decision that you declare after that assessment doesn't change this value. The next assessment calculates a new percentage. Absent when <code>status</code> is <code>NOT_ASSESSED</code> or <code>NOT_APPLICABLE</code>.</p>
pub fn outcome_percentage(mut self, input: f64) -> Self {
self.outcome_percentage = ::std::option::Option::Some(input);
self
}
/// <p>The compliance percentage that the most recent assessment of the control calculated. A decision that you declare after that assessment doesn't change this value. The next assessment calculates a new percentage. Absent when <code>status</code> is <code>NOT_ASSESSED</code> or <code>NOT_APPLICABLE</code>.</p>
pub fn set_outcome_percentage(mut self, input: ::std::option::Option<f64>) -> Self {
self.outcome_percentage = input;
self
}
/// <p>The compliance percentage that the most recent assessment of the control calculated. A decision that you declare after that assessment doesn't change this value. The next assessment calculates a new percentage. Absent when <code>status</code> is <code>NOT_ASSESSED</code> or <code>NOT_APPLICABLE</code>.</p>
pub fn get_outcome_percentage(&self) -> &::std::option::Option<f64> {
&self.outcome_percentage
}
/// <p>The number of the control's requirements that apply to the project.</p>
/// This field is required.
pub fn applicable_requirement_count(mut self, input: i32) -> Self {
self.applicable_requirement_count = ::std::option::Option::Some(input);
self
}
/// <p>The number of the control's requirements that apply to the project.</p>
pub fn set_applicable_requirement_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.applicable_requirement_count = input;
self
}
/// <p>The number of the control's requirements that apply to the project.</p>
pub fn get_applicable_requirement_count(&self) -> &::std::option::Option<i32> {
&self.applicable_requirement_count
}
/// <p>The number of the control's requirements whose status is <code>not_applicable</code>. The count includes requirements that you declare not applicable, directly or through the control. It also includes requirements that the assessment determines don't apply.</p>
/// This field is required.
pub fn excluded_requirement_count(mut self, input: i32) -> Self {
self.excluded_requirement_count = ::std::option::Option::Some(input);
self
}
/// <p>The number of the control's requirements whose status is <code>not_applicable</code>. The count includes requirements that you declare not applicable, directly or through the control. It also includes requirements that the assessment determines don't apply.</p>
pub fn set_excluded_requirement_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.excluded_requirement_count = input;
self
}
/// <p>The number of the control's requirements whose status is <code>not_applicable</code>. The count includes requirements that you declare not applicable, directly or through the control. It also includes requirements that the assessment determines don't apply.</p>
pub fn get_excluded_requirement_count(&self) -> &::std::option::Option<i32> {
&self.excluded_requirement_count
}
/// <p>The decision declared on the control itself. Absent when no decision is declared on the control. Decisions on individual requirements are returned in <code>requirementStatuses</code>.</p>
pub fn status_override(mut self, input: crate::types::StatusOverride) -> Self {
self.status_override = ::std::option::Option::Some(input);
self
}
/// <p>The decision declared on the control itself. Absent when no decision is declared on the control. Decisions on individual requirements are returned in <code>requirementStatuses</code>.</p>
pub fn set_status_override(mut self, input: ::std::option::Option<crate::types::StatusOverride>) -> Self {
self.status_override = input;
self
}
/// <p>The decision declared on the control itself. Absent when no decision is declared on the control. Decisions on individual requirements are returned in <code>requirementStatuses</code>.</p>
pub fn get_status_override(&self) -> &::std::option::Option<crate::types::StatusOverride> {
&self.status_override
}
/// <p>The identifier of the most recent assessment of the control in the project. Absent if no assessment has run for the control.</p>
pub fn last_assessment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.last_assessment_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the most recent assessment of the control in the project. Absent if no assessment has run for the control.</p>
pub fn set_last_assessment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.last_assessment_id = input;
self
}
/// <p>The identifier of the most recent assessment of the control in the project. Absent if no assessment has run for the control.</p>
pub fn get_last_assessment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.last_assessment_id
}
/// <p>The time when the most recent assessment of the control was last updated.</p>
pub fn last_assessed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_assessed_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the most recent assessment of the control was last updated.</p>
pub fn set_last_assessed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_assessed_at = input;
self
}
/// <p>The time when the most recent assessment of the control was last updated.</p>
pub fn get_last_assessed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_assessed_at
}
/// <p>The state of the most recent assessment of the control.</p>
pub fn last_assessment_status(mut self, input: crate::types::AssessmentStatus) -> Self {
self.last_assessment_status = ::std::option::Option::Some(input);
self
}
/// <p>The state of the most recent assessment of the control.</p>
pub fn set_last_assessment_status(mut self, input: ::std::option::Option<crate::types::AssessmentStatus>) -> Self {
self.last_assessment_status = input;
self
}
/// <p>The state of the most recent assessment of the control.</p>
pub fn get_last_assessment_status(&self) -> &::std::option::Option<crate::types::AssessmentStatus> {
&self.last_assessment_status
}
/// Appends an item to `requirement_statuses`.
///
/// To override the contents of this collection use [`set_requirement_statuses`](Self::set_requirement_statuses).
///
/// <p>The effective status of each of the control's requirements, including requirements that are not applicable.</p>
pub fn requirement_statuses(mut self, input: crate::types::RequirementStatus) -> Self {
let mut v = self.requirement_statuses.unwrap_or_default();
v.push(input);
self.requirement_statuses = ::std::option::Option::Some(v);
self
}
/// <p>The effective status of each of the control's requirements, including requirements that are not applicable.</p>
pub fn set_requirement_statuses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequirementStatus>>) -> Self {
self.requirement_statuses = input;
self
}
/// <p>The effective status of each of the control's requirements, including requirements that are not applicable.</p>
pub fn get_requirement_statuses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequirementStatus>> {
&self.requirement_statuses
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`GetControlStatusOutput`](crate::operation::get_control_status::GetControlStatusOutput).
/// This method will fail if any of the following fields are not set:
/// - [`control_id`](crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::control_id)
/// - [`status`](crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::status)
/// - [`applicable_requirement_count`](crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::applicable_requirement_count)
/// - [`excluded_requirement_count`](crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::excluded_requirement_count)
/// - [`requirement_statuses`](crate::operation::get_control_status::builders::GetControlStatusOutputBuilder::requirement_statuses)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::get_control_status::GetControlStatusOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_control_status::GetControlStatusOutput {
control_id: self.control_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"control_id",
"control_id was not specified but it is required when building GetControlStatusOutput",
)
})?,
control_group_id: self.control_group_id,
status: self.status.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"status",
"status was not specified but it is required when building GetControlStatusOutput",
)
})?,
outcome_percentage: self.outcome_percentage,
applicable_requirement_count: self.applicable_requirement_count.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"applicable_requirement_count",
"applicable_requirement_count was not specified but it is required when building GetControlStatusOutput",
)
})?,
excluded_requirement_count: self.excluded_requirement_count.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"excluded_requirement_count",
"excluded_requirement_count was not specified but it is required when building GetControlStatusOutput",
)
})?,
status_override: self.status_override,
last_assessment_id: self.last_assessment_id,
last_assessed_at: self.last_assessed_at,
last_assessment_status: self.last_assessment_status,
requirement_statuses: self.requirement_statuses.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"requirement_statuses",
"requirement_statuses was not specified but it is required when building GetControlStatusOutput",
)
})?,
_request_id: self._request_id,
})
}
}