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
373
374
375
376
377
378
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A leaf control within a framework version, with its full attributes including its requirements. To retrieve the attributes of the control group it belongs to, use <code>GetControlGroup</code>. To retrieve the other controls in that group, use <code>ListControls</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Control {
/// <p>The type of the control.</p>
pub r#type: crate::types::ControlType,
/// <p>The name of the compliance framework.</p>
pub framework: ::std::option::Option<::std::string::String>,
/// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
pub control_id: ::std::option::Option<::std::string::String>,
/// <p>The version of the compliance framework.</p>
pub framework_version: ::std::option::Option<::std::string::String>,
/// <p>The parent group ID (for example, "A.2" for control "A.2.2").</p>
pub group_id: ::std::option::Option<::std::string::String>,
/// <p>The human-readable title of the control.</p>
pub title: ::std::option::Option<::std::string::String>,
/// <p>A description of the control.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>The individual checks an assessment scores for this control. Absent when the control has none.</p>
pub requirements: ::std::option::Option<::std::vec::Vec<crate::types::Requirement>>,
/// <p>The technical control intents classify how an assessment evaluates this leaf control. Leaf controls only.</p>
pub control_intents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>How AWS Assurance evaluates the control. Applies only to leaf controls. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>automated-scan</code> – Evaluates the configuration of your AWS resources.</p></li>
/// <li>
/// <p><code>document</code> – Evaluates the evidence documents that you provide.</p></li>
/// <li>
/// <p><code>hybrid</code> – Evaluates both resource configuration and evidence documents.</p></li>
/// </ul>
pub workflow_type: ::std::option::Option<crate::types::WorkflowType>,
/// <p>The lifecycle status of the control.</p>
pub status: ::std::option::Option<crate::types::ReleaseStatus>,
/// <p>The time when you created the control. The response includes it only for controls in custom frameworks.</p>
pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The time when the control was last modified. Returned for controls in custom frameworks only.</p>
pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Control {
/// <p>The type of the control.</p>
pub fn r#type(&self) -> &crate::types::ControlType {
&self.r#type
}
/// <p>The name of the compliance framework.</p>
pub fn framework(&self) -> ::std::option::Option<&str> {
self.framework.as_deref()
}
/// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
pub fn control_id(&self) -> ::std::option::Option<&str> {
self.control_id.as_deref()
}
/// <p>The version of the compliance framework.</p>
pub fn framework_version(&self) -> ::std::option::Option<&str> {
self.framework_version.as_deref()
}
/// <p>The parent group ID (for example, "A.2" for control "A.2.2").</p>
pub fn group_id(&self) -> ::std::option::Option<&str> {
self.group_id.as_deref()
}
/// <p>The human-readable title of the control.</p>
pub fn title(&self) -> ::std::option::Option<&str> {
self.title.as_deref()
}
/// <p>A description of the control.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>The individual checks an assessment scores for this control. Absent when the control has none.</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 `.requirements.is_none()`.
pub fn requirements(&self) -> &[crate::types::Requirement] {
self.requirements.as_deref().unwrap_or_default()
}
/// <p>The technical control intents classify how an assessment evaluates this leaf control. Leaf controls only.</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 `.control_intents.is_none()`.
pub fn control_intents(&self) -> &[::std::string::String] {
self.control_intents.as_deref().unwrap_or_default()
}
/// <p>How AWS Assurance evaluates the control. Applies only to leaf controls. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>automated-scan</code> – Evaluates the configuration of your AWS resources.</p></li>
/// <li>
/// <p><code>document</code> – Evaluates the evidence documents that you provide.</p></li>
/// <li>
/// <p><code>hybrid</code> – Evaluates both resource configuration and evidence documents.</p></li>
/// </ul>
pub fn workflow_type(&self) -> ::std::option::Option<&crate::types::WorkflowType> {
self.workflow_type.as_ref()
}
/// <p>The lifecycle status of the control.</p>
pub fn status(&self) -> ::std::option::Option<&crate::types::ReleaseStatus> {
self.status.as_ref()
}
/// <p>The time when you created the control. The response includes it only for controls in custom frameworks.</p>
pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_at.as_ref()
}
/// <p>The time when the control was last modified. Returned for controls in custom frameworks only.</p>
pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.updated_at.as_ref()
}
}
impl Control {
/// Creates a new builder-style object to manufacture [`Control`](crate::types::Control).
pub fn builder() -> crate::types::builders::ControlBuilder {
crate::types::builders::ControlBuilder::default()
}
}
/// A builder for [`Control`](crate::types::Control).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ControlBuilder {
pub(crate) r#type: ::std::option::Option<crate::types::ControlType>,
pub(crate) framework: ::std::option::Option<::std::string::String>,
pub(crate) control_id: ::std::option::Option<::std::string::String>,
pub(crate) framework_version: ::std::option::Option<::std::string::String>,
pub(crate) group_id: ::std::option::Option<::std::string::String>,
pub(crate) title: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) requirements: ::std::option::Option<::std::vec::Vec<crate::types::Requirement>>,
pub(crate) control_intents: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) workflow_type: ::std::option::Option<crate::types::WorkflowType>,
pub(crate) status: ::std::option::Option<crate::types::ReleaseStatus>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ControlBuilder {
/// <p>The type of the control.</p>
/// This field is required.
pub fn r#type(mut self, input: crate::types::ControlType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
/// <p>The type of the control.</p>
pub fn set_type(mut self, input: ::std::option::Option<crate::types::ControlType>) -> Self {
self.r#type = input;
self
}
/// <p>The type of the control.</p>
pub fn get_type(&self) -> &::std::option::Option<crate::types::ControlType> {
&self.r#type
}
/// <p>The name of the compliance framework.</p>
pub fn framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.framework = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the compliance framework.</p>
pub fn set_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.framework = input;
self
}
/// <p>The name of the compliance framework.</p>
pub fn get_framework(&self) -> &::std::option::Option<::std::string::String> {
&self.framework
}
/// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
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 control identifier. Optional. If omitted, the operation applies to the full framework.</p>
pub fn set_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.control_id = input;
self
}
/// <p>The control identifier. Optional. If omitted, the operation applies to the full framework.</p>
pub fn get_control_id(&self) -> &::std::option::Option<::std::string::String> {
&self.control_id
}
/// <p>The version of the compliance framework.</p>
pub fn framework_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.framework_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version of the compliance framework.</p>
pub fn set_framework_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.framework_version = input;
self
}
/// <p>The version of the compliance framework.</p>
pub fn get_framework_version(&self) -> &::std::option::Option<::std::string::String> {
&self.framework_version
}
/// <p>The parent group ID (for example, "A.2" for control "A.2.2").</p>
pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The parent group ID (for example, "A.2" for control "A.2.2").</p>
pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_id = input;
self
}
/// <p>The parent group ID (for example, "A.2" for control "A.2.2").</p>
pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.group_id
}
/// <p>The human-readable title of the control.</p>
pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.title = ::std::option::Option::Some(input.into());
self
}
/// <p>The human-readable title of the control.</p>
pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.title = input;
self
}
/// <p>The human-readable title of the control.</p>
pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
&self.title
}
/// <p>A description of the control.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the control.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the control.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// Appends an item to `requirements`.
///
/// To override the contents of this collection use [`set_requirements`](Self::set_requirements).
///
/// <p>The individual checks an assessment scores for this control. Absent when the control has none.</p>
pub fn requirements(mut self, input: crate::types::Requirement) -> Self {
let mut v = self.requirements.unwrap_or_default();
v.push(input);
self.requirements = ::std::option::Option::Some(v);
self
}
/// <p>The individual checks an assessment scores for this control. Absent when the control has none.</p>
pub fn set_requirements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Requirement>>) -> Self {
self.requirements = input;
self
}
/// <p>The individual checks an assessment scores for this control. Absent when the control has none.</p>
pub fn get_requirements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Requirement>> {
&self.requirements
}
/// Appends an item to `control_intents`.
///
/// To override the contents of this collection use [`set_control_intents`](Self::set_control_intents).
///
/// <p>The technical control intents classify how an assessment evaluates this leaf control. Leaf controls only.</p>
pub fn control_intents(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.control_intents.unwrap_or_default();
v.push(input.into());
self.control_intents = ::std::option::Option::Some(v);
self
}
/// <p>The technical control intents classify how an assessment evaluates this leaf control. Leaf controls only.</p>
pub fn set_control_intents(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.control_intents = input;
self
}
/// <p>The technical control intents classify how an assessment evaluates this leaf control. Leaf controls only.</p>
pub fn get_control_intents(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.control_intents
}
/// <p>How AWS Assurance evaluates the control. Applies only to leaf controls. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>automated-scan</code> – Evaluates the configuration of your AWS resources.</p></li>
/// <li>
/// <p><code>document</code> – Evaluates the evidence documents that you provide.</p></li>
/// <li>
/// <p><code>hybrid</code> – Evaluates both resource configuration and evidence documents.</p></li>
/// </ul>
pub fn workflow_type(mut self, input: crate::types::WorkflowType) -> Self {
self.workflow_type = ::std::option::Option::Some(input);
self
}
/// <p>How AWS Assurance evaluates the control. Applies only to leaf controls. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>automated-scan</code> – Evaluates the configuration of your AWS resources.</p></li>
/// <li>
/// <p><code>document</code> – Evaluates the evidence documents that you provide.</p></li>
/// <li>
/// <p><code>hybrid</code> – Evaluates both resource configuration and evidence documents.</p></li>
/// </ul>
pub fn set_workflow_type(mut self, input: ::std::option::Option<crate::types::WorkflowType>) -> Self {
self.workflow_type = input;
self
}
/// <p>How AWS Assurance evaluates the control. Applies only to leaf controls. Valid values:</p>
/// <ul>
/// <li>
/// <p><code>automated-scan</code> – Evaluates the configuration of your AWS resources.</p></li>
/// <li>
/// <p><code>document</code> – Evaluates the evidence documents that you provide.</p></li>
/// <li>
/// <p><code>hybrid</code> – Evaluates both resource configuration and evidence documents.</p></li>
/// </ul>
pub fn get_workflow_type(&self) -> &::std::option::Option<crate::types::WorkflowType> {
&self.workflow_type
}
/// <p>The lifecycle status of the control.</p>
pub fn status(mut self, input: crate::types::ReleaseStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The lifecycle status of the control.</p>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ReleaseStatus>) -> Self {
self.status = input;
self
}
/// <p>The lifecycle status of the control.</p>
pub fn get_status(&self) -> &::std::option::Option<crate::types::ReleaseStatus> {
&self.status
}
/// <p>The time when you created the control. The response includes it only for controls in custom frameworks.</p>
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when you created the control. The response includes it only for controls in custom frameworks.</p>
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
/// <p>The time when you created the control. The response includes it only for controls in custom frameworks.</p>
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
/// <p>The time when the control was last modified. Returned for controls in custom frameworks only.</p>
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
/// <p>The time when the control was last modified. Returned for controls in custom frameworks only.</p>
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
/// <p>The time when the control was last modified. Returned for controls in custom frameworks only.</p>
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
/// Consumes the builder and constructs a [`Control`](crate::types::Control).
/// This method will fail if any of the following fields are not set:
/// - [`r#type`](crate::types::builders::ControlBuilder::type)
pub fn build(self) -> ::std::result::Result<crate::types::Control, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Control {
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Control",
)
})?,
framework: self.framework,
control_id: self.control_id,
framework_version: self.framework_version,
group_id: self.group_id,
title: self.title,
description: self.description,
requirements: self.requirements,
control_intents: self.control_intents,
workflow_type: self.workflow_type,
status: self.status,
created_at: self.created_at,
updated_at: self.updated_at,
})
}
}