Skip to main content

aws_sdk_auditmanager/types/
_control.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A control in Audit Manager.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct Control {
7    /// <p>The Amazon Resource Name (ARN) of the control.</p>
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// <p>The unique identifier for the control.</p>
10    pub id: ::std::option::Option<::std::string::String>,
11    /// <p>Specifies whether the control is a standard control or a custom control.</p>
12    pub r#type: ::std::option::Option<crate::types::ControlType>,
13    /// <p>The name of the control.</p>
14    pub name: ::std::option::Option<::std::string::String>,
15    /// <p>The description of the control.</p>
16    pub description: ::std::option::Option<::std::string::String>,
17    /// <p>The steps that you should follow to determine if the control has been satisfied.</p>
18    pub testing_information: ::std::option::Option<::std::string::String>,
19    /// <p>The title of the action plan for remediating the control.</p>
20    pub action_plan_title: ::std::option::Option<::std::string::String>,
21    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
22    pub action_plan_instructions: ::std::option::Option<::std::string::String>,
23    /// <p>The data source types that determine where Audit Manager collects evidence from for the control.</p>
24    pub control_sources: ::std::option::Option<::std::string::String>,
25    /// <p>The data mapping sources for the control.</p>
26    pub control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>,
27    /// <p>The time when the control was created.</p>
28    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
29    /// <p>The time when the control was most recently updated.</p>
30    pub last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
31    /// <p>The user or role that created the control.</p>
32    pub created_by: ::std::option::Option<::std::string::String>,
33    /// <p>The user or role that most recently updated the control.</p>
34    pub last_updated_by: ::std::option::Option<::std::string::String>,
35    /// <p>The tags associated with the control.</p>
36    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37    /// <p>The state of the control. The <code>END_OF_SUPPORT</code> state is applicable to standard controls only. This state indicates that the standard control can still be used to collect evidence, but Audit Manager is no longer updating or maintaining that control.</p>
38    pub state: ::std::option::Option<crate::types::ControlState>,
39}
40impl Control {
41    /// <p>The Amazon Resource Name (ARN) of the control.</p>
42    pub fn arn(&self) -> ::std::option::Option<&str> {
43        self.arn.as_deref()
44    }
45    /// <p>The unique identifier for the control.</p>
46    pub fn id(&self) -> ::std::option::Option<&str> {
47        self.id.as_deref()
48    }
49    /// <p>Specifies whether the control is a standard control or a custom control.</p>
50    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ControlType> {
51        self.r#type.as_ref()
52    }
53    /// <p>The name of the control.</p>
54    pub fn name(&self) -> ::std::option::Option<&str> {
55        self.name.as_deref()
56    }
57    /// <p>The description of the control.</p>
58    pub fn description(&self) -> ::std::option::Option<&str> {
59        self.description.as_deref()
60    }
61    /// <p>The steps that you should follow to determine if the control has been satisfied.</p>
62    pub fn testing_information(&self) -> ::std::option::Option<&str> {
63        self.testing_information.as_deref()
64    }
65    /// <p>The title of the action plan for remediating the control.</p>
66    pub fn action_plan_title(&self) -> ::std::option::Option<&str> {
67        self.action_plan_title.as_deref()
68    }
69    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
70    pub fn action_plan_instructions(&self) -> ::std::option::Option<&str> {
71        self.action_plan_instructions.as_deref()
72    }
73    /// <p>The data source types that determine where Audit Manager collects evidence from for the control.</p>
74    pub fn control_sources(&self) -> ::std::option::Option<&str> {
75        self.control_sources.as_deref()
76    }
77    /// <p>The data mapping sources for the control.</p>
78    ///
79    /// 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_mapping_sources.is_none()`.
80    pub fn control_mapping_sources(&self) -> &[crate::types::ControlMappingSource] {
81        self.control_mapping_sources.as_deref().unwrap_or_default()
82    }
83    /// <p>The time when the control was created.</p>
84    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
85        self.created_at.as_ref()
86    }
87    /// <p>The time when the control was most recently updated.</p>
88    pub fn last_updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
89        self.last_updated_at.as_ref()
90    }
91    /// <p>The user or role that created the control.</p>
92    pub fn created_by(&self) -> ::std::option::Option<&str> {
93        self.created_by.as_deref()
94    }
95    /// <p>The user or role that most recently updated the control.</p>
96    pub fn last_updated_by(&self) -> ::std::option::Option<&str> {
97        self.last_updated_by.as_deref()
98    }
99    /// <p>The tags associated with the control.</p>
100    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
101        self.tags.as_ref()
102    }
103    /// <p>The state of the control. The <code>END_OF_SUPPORT</code> state is applicable to standard controls only. This state indicates that the standard control can still be used to collect evidence, but Audit Manager is no longer updating or maintaining that control.</p>
104    pub fn state(&self) -> ::std::option::Option<&crate::types::ControlState> {
105        self.state.as_ref()
106    }
107}
108impl ::std::fmt::Debug for Control {
109    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
110        let mut formatter = f.debug_struct("Control");
111        formatter.field("arn", &self.arn);
112        formatter.field("id", &self.id);
113        formatter.field("r#type", &self.r#type);
114        formatter.field("name", &self.name);
115        formatter.field("description", &"*** Sensitive Data Redacted ***");
116        formatter.field("testing_information", &"*** Sensitive Data Redacted ***");
117        formatter.field("action_plan_title", &"*** Sensitive Data Redacted ***");
118        formatter.field("action_plan_instructions", &"*** Sensitive Data Redacted ***");
119        formatter.field("control_sources", &self.control_sources);
120        formatter.field("control_mapping_sources", &self.control_mapping_sources);
121        formatter.field("created_at", &self.created_at);
122        formatter.field("last_updated_at", &self.last_updated_at);
123        formatter.field("created_by", &"*** Sensitive Data Redacted ***");
124        formatter.field("last_updated_by", &"*** Sensitive Data Redacted ***");
125        formatter.field("tags", &self.tags);
126        formatter.field("state", &self.state);
127        formatter.finish()
128    }
129}
130impl Control {
131    /// Creates a new builder-style object to manufacture [`Control`](crate::types::Control).
132    pub fn builder() -> crate::types::builders::ControlBuilder {
133        crate::types::builders::ControlBuilder::default()
134    }
135}
136
137/// A builder for [`Control`](crate::types::Control).
138#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
139#[non_exhaustive]
140pub struct ControlBuilder {
141    pub(crate) arn: ::std::option::Option<::std::string::String>,
142    pub(crate) id: ::std::option::Option<::std::string::String>,
143    pub(crate) r#type: ::std::option::Option<crate::types::ControlType>,
144    pub(crate) name: ::std::option::Option<::std::string::String>,
145    pub(crate) description: ::std::option::Option<::std::string::String>,
146    pub(crate) testing_information: ::std::option::Option<::std::string::String>,
147    pub(crate) action_plan_title: ::std::option::Option<::std::string::String>,
148    pub(crate) action_plan_instructions: ::std::option::Option<::std::string::String>,
149    pub(crate) control_sources: ::std::option::Option<::std::string::String>,
150    pub(crate) control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>,
151    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
152    pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
153    pub(crate) created_by: ::std::option::Option<::std::string::String>,
154    pub(crate) last_updated_by: ::std::option::Option<::std::string::String>,
155    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
156    pub(crate) state: ::std::option::Option<crate::types::ControlState>,
157}
158impl ControlBuilder {
159    /// <p>The Amazon Resource Name (ARN) of the control.</p>
160    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.arn = ::std::option::Option::Some(input.into());
162        self
163    }
164    /// <p>The Amazon Resource Name (ARN) of the control.</p>
165    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.arn = input;
167        self
168    }
169    /// <p>The Amazon Resource Name (ARN) of the control.</p>
170    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
171        &self.arn
172    }
173    /// <p>The unique identifier for the control.</p>
174    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.id = ::std::option::Option::Some(input.into());
176        self
177    }
178    /// <p>The unique identifier for the control.</p>
179    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.id = input;
181        self
182    }
183    /// <p>The unique identifier for the control.</p>
184    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
185        &self.id
186    }
187    /// <p>Specifies whether the control is a standard control or a custom control.</p>
188    pub fn r#type(mut self, input: crate::types::ControlType) -> Self {
189        self.r#type = ::std::option::Option::Some(input);
190        self
191    }
192    /// <p>Specifies whether the control is a standard control or a custom control.</p>
193    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ControlType>) -> Self {
194        self.r#type = input;
195        self
196    }
197    /// <p>Specifies whether the control is a standard control or a custom control.</p>
198    pub fn get_type(&self) -> &::std::option::Option<crate::types::ControlType> {
199        &self.r#type
200    }
201    /// <p>The name of the control.</p>
202    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
203        self.name = ::std::option::Option::Some(input.into());
204        self
205    }
206    /// <p>The name of the control.</p>
207    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208        self.name = input;
209        self
210    }
211    /// <p>The name of the control.</p>
212    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
213        &self.name
214    }
215    /// <p>The description of the control.</p>
216    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.description = ::std::option::Option::Some(input.into());
218        self
219    }
220    /// <p>The description of the control.</p>
221    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222        self.description = input;
223        self
224    }
225    /// <p>The description of the control.</p>
226    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
227        &self.description
228    }
229    /// <p>The steps that you should follow to determine if the control has been satisfied.</p>
230    pub fn testing_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.testing_information = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>The steps that you should follow to determine if the control has been satisfied.</p>
235    pub fn set_testing_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.testing_information = input;
237        self
238    }
239    /// <p>The steps that you should follow to determine if the control has been satisfied.</p>
240    pub fn get_testing_information(&self) -> &::std::option::Option<::std::string::String> {
241        &self.testing_information
242    }
243    /// <p>The title of the action plan for remediating the control.</p>
244    pub fn action_plan_title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.action_plan_title = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>The title of the action plan for remediating the control.</p>
249    pub fn set_action_plan_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.action_plan_title = input;
251        self
252    }
253    /// <p>The title of the action plan for remediating the control.</p>
254    pub fn get_action_plan_title(&self) -> &::std::option::Option<::std::string::String> {
255        &self.action_plan_title
256    }
257    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
258    pub fn action_plan_instructions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.action_plan_instructions = ::std::option::Option::Some(input.into());
260        self
261    }
262    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
263    pub fn set_action_plan_instructions(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.action_plan_instructions = input;
265        self
266    }
267    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
268    pub fn get_action_plan_instructions(&self) -> &::std::option::Option<::std::string::String> {
269        &self.action_plan_instructions
270    }
271    /// <p>The data source types that determine where Audit Manager collects evidence from for the control.</p>
272    pub fn control_sources(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.control_sources = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <p>The data source types that determine where Audit Manager collects evidence from for the control.</p>
277    pub fn set_control_sources(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.control_sources = input;
279        self
280    }
281    /// <p>The data source types that determine where Audit Manager collects evidence from for the control.</p>
282    pub fn get_control_sources(&self) -> &::std::option::Option<::std::string::String> {
283        &self.control_sources
284    }
285    /// Appends an item to `control_mapping_sources`.
286    ///
287    /// To override the contents of this collection use [`set_control_mapping_sources`](Self::set_control_mapping_sources).
288    ///
289    /// <p>The data mapping sources for the control.</p>
290    pub fn control_mapping_sources(mut self, input: crate::types::ControlMappingSource) -> Self {
291        let mut v = self.control_mapping_sources.unwrap_or_default();
292        v.push(input);
293        self.control_mapping_sources = ::std::option::Option::Some(v);
294        self
295    }
296    /// <p>The data mapping sources for the control.</p>
297    pub fn set_control_mapping_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>) -> Self {
298        self.control_mapping_sources = input;
299        self
300    }
301    /// <p>The data mapping sources for the control.</p>
302    pub fn get_control_mapping_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>> {
303        &self.control_mapping_sources
304    }
305    /// <p>The time when the control was created.</p>
306    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
307        self.created_at = ::std::option::Option::Some(input);
308        self
309    }
310    /// <p>The time when the control was created.</p>
311    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
312        self.created_at = input;
313        self
314    }
315    /// <p>The time when the control was created.</p>
316    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
317        &self.created_at
318    }
319    /// <p>The time when the control was most recently updated.</p>
320    pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
321        self.last_updated_at = ::std::option::Option::Some(input);
322        self
323    }
324    /// <p>The time when the control was most recently updated.</p>
325    pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
326        self.last_updated_at = input;
327        self
328    }
329    /// <p>The time when the control was most recently updated.</p>
330    pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
331        &self.last_updated_at
332    }
333    /// <p>The user or role that created the control.</p>
334    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
335        self.created_by = ::std::option::Option::Some(input.into());
336        self
337    }
338    /// <p>The user or role that created the control.</p>
339    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
340        self.created_by = input;
341        self
342    }
343    /// <p>The user or role that created the control.</p>
344    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
345        &self.created_by
346    }
347    /// <p>The user or role that most recently updated the control.</p>
348    pub fn last_updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
349        self.last_updated_by = ::std::option::Option::Some(input.into());
350        self
351    }
352    /// <p>The user or role that most recently updated the control.</p>
353    pub fn set_last_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
354        self.last_updated_by = input;
355        self
356    }
357    /// <p>The user or role that most recently updated the control.</p>
358    pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
359        &self.last_updated_by
360    }
361    /// Adds a key-value pair to `tags`.
362    ///
363    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
364    ///
365    /// <p>The tags associated with the control.</p>
366    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
367        let mut hash_map = self.tags.unwrap_or_default();
368        hash_map.insert(k.into(), v.into());
369        self.tags = ::std::option::Option::Some(hash_map);
370        self
371    }
372    /// <p>The tags associated with the control.</p>
373    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
374        self.tags = input;
375        self
376    }
377    /// <p>The tags associated with the control.</p>
378    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
379        &self.tags
380    }
381    /// <p>The state of the control. The <code>END_OF_SUPPORT</code> state is applicable to standard controls only. This state indicates that the standard control can still be used to collect evidence, but Audit Manager is no longer updating or maintaining that control.</p>
382    pub fn state(mut self, input: crate::types::ControlState) -> Self {
383        self.state = ::std::option::Option::Some(input);
384        self
385    }
386    /// <p>The state of the control. The <code>END_OF_SUPPORT</code> state is applicable to standard controls only. This state indicates that the standard control can still be used to collect evidence, but Audit Manager is no longer updating or maintaining that control.</p>
387    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ControlState>) -> Self {
388        self.state = input;
389        self
390    }
391    /// <p>The state of the control. The <code>END_OF_SUPPORT</code> state is applicable to standard controls only. This state indicates that the standard control can still be used to collect evidence, but Audit Manager is no longer updating or maintaining that control.</p>
392    pub fn get_state(&self) -> &::std::option::Option<crate::types::ControlState> {
393        &self.state
394    }
395    /// Consumes the builder and constructs a [`Control`](crate::types::Control).
396    pub fn build(self) -> crate::types::Control {
397        crate::types::Control {
398            arn: self.arn,
399            id: self.id,
400            r#type: self.r#type,
401            name: self.name,
402            description: self.description,
403            testing_information: self.testing_information,
404            action_plan_title: self.action_plan_title,
405            action_plan_instructions: self.action_plan_instructions,
406            control_sources: self.control_sources,
407            control_mapping_sources: self.control_mapping_sources,
408            created_at: self.created_at,
409            last_updated_at: self.last_updated_at,
410            created_by: self.created_by,
411            last_updated_by: self.last_updated_by,
412            tags: self.tags,
413            state: self.state,
414        }
415    }
416}
417impl ::std::fmt::Debug for ControlBuilder {
418    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
419        let mut formatter = f.debug_struct("ControlBuilder");
420        formatter.field("arn", &self.arn);
421        formatter.field("id", &self.id);
422        formatter.field("r#type", &self.r#type);
423        formatter.field("name", &self.name);
424        formatter.field("description", &"*** Sensitive Data Redacted ***");
425        formatter.field("testing_information", &"*** Sensitive Data Redacted ***");
426        formatter.field("action_plan_title", &"*** Sensitive Data Redacted ***");
427        formatter.field("action_plan_instructions", &"*** Sensitive Data Redacted ***");
428        formatter.field("control_sources", &self.control_sources);
429        formatter.field("control_mapping_sources", &self.control_mapping_sources);
430        formatter.field("created_at", &self.created_at);
431        formatter.field("last_updated_at", &self.last_updated_at);
432        formatter.field("created_by", &"*** Sensitive Data Redacted ***");
433        formatter.field("last_updated_by", &"*** Sensitive Data Redacted ***");
434        formatter.field("tags", &self.tags);
435        formatter.field("state", &self.state);
436        formatter.finish()
437    }
438}