aws_sdk_auditmanager/operation/update_control/
_update_control_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct UpdateControlInput {
6    /// <p>The identifier for the control.</p>
7    pub control_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the updated control.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The optional description of the control.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The steps that you should follow to determine if the control is met.</p>
13    pub testing_information: ::std::option::Option<::std::string::String>,
14    /// <p>The title of the action plan for remediating the control.</p>
15    pub action_plan_title: ::std::option::Option<::std::string::String>,
16    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
17    pub action_plan_instructions: ::std::option::Option<::std::string::String>,
18    /// <p>The data mapping sources for the control.</p>
19    pub control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>,
20}
21impl UpdateControlInput {
22    /// <p>The identifier for the control.</p>
23    pub fn control_id(&self) -> ::std::option::Option<&str> {
24        self.control_id.as_deref()
25    }
26    /// <p>The name of the updated control.</p>
27    pub fn name(&self) -> ::std::option::Option<&str> {
28        self.name.as_deref()
29    }
30    /// <p>The optional description of the control.</p>
31    pub fn description(&self) -> ::std::option::Option<&str> {
32        self.description.as_deref()
33    }
34    /// <p>The steps that you should follow to determine if the control is met.</p>
35    pub fn testing_information(&self) -> ::std::option::Option<&str> {
36        self.testing_information.as_deref()
37    }
38    /// <p>The title of the action plan for remediating the control.</p>
39    pub fn action_plan_title(&self) -> ::std::option::Option<&str> {
40        self.action_plan_title.as_deref()
41    }
42    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
43    pub fn action_plan_instructions(&self) -> ::std::option::Option<&str> {
44        self.action_plan_instructions.as_deref()
45    }
46    /// <p>The data mapping sources for the control.</p>
47    ///
48    /// 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()`.
49    pub fn control_mapping_sources(&self) -> &[crate::types::ControlMappingSource] {
50        self.control_mapping_sources.as_deref().unwrap_or_default()
51    }
52}
53impl ::std::fmt::Debug for UpdateControlInput {
54    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
55        let mut formatter = f.debug_struct("UpdateControlInput");
56        formatter.field("control_id", &self.control_id);
57        formatter.field("name", &self.name);
58        formatter.field("description", &"*** Sensitive Data Redacted ***");
59        formatter.field("testing_information", &"*** Sensitive Data Redacted ***");
60        formatter.field("action_plan_title", &"*** Sensitive Data Redacted ***");
61        formatter.field("action_plan_instructions", &"*** Sensitive Data Redacted ***");
62        formatter.field("control_mapping_sources", &self.control_mapping_sources);
63        formatter.finish()
64    }
65}
66impl UpdateControlInput {
67    /// Creates a new builder-style object to manufacture [`UpdateControlInput`](crate::operation::update_control::UpdateControlInput).
68    pub fn builder() -> crate::operation::update_control::builders::UpdateControlInputBuilder {
69        crate::operation::update_control::builders::UpdateControlInputBuilder::default()
70    }
71}
72
73/// A builder for [`UpdateControlInput`](crate::operation::update_control::UpdateControlInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
75#[non_exhaustive]
76pub struct UpdateControlInputBuilder {
77    pub(crate) control_id: ::std::option::Option<::std::string::String>,
78    pub(crate) name: ::std::option::Option<::std::string::String>,
79    pub(crate) description: ::std::option::Option<::std::string::String>,
80    pub(crate) testing_information: ::std::option::Option<::std::string::String>,
81    pub(crate) action_plan_title: ::std::option::Option<::std::string::String>,
82    pub(crate) action_plan_instructions: ::std::option::Option<::std::string::String>,
83    pub(crate) control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>,
84}
85impl UpdateControlInputBuilder {
86    /// <p>The identifier for the control.</p>
87    /// This field is required.
88    pub fn control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.control_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The identifier for the control.</p>
93    pub fn set_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.control_id = input;
95        self
96    }
97    /// <p>The identifier for the control.</p>
98    pub fn get_control_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.control_id
100    }
101    /// <p>The name of the updated control.</p>
102    /// This field is required.
103    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The name of the updated control.</p>
108    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.name = input;
110        self
111    }
112    /// <p>The name of the updated control.</p>
113    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
114        &self.name
115    }
116    /// <p>The optional description of the control.</p>
117    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.description = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The optional description of the control.</p>
122    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.description = input;
124        self
125    }
126    /// <p>The optional description of the control.</p>
127    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
128        &self.description
129    }
130    /// <p>The steps that you should follow to determine if the control is met.</p>
131    pub fn testing_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.testing_information = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The steps that you should follow to determine if the control is met.</p>
136    pub fn set_testing_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.testing_information = input;
138        self
139    }
140    /// <p>The steps that you should follow to determine if the control is met.</p>
141    pub fn get_testing_information(&self) -> &::std::option::Option<::std::string::String> {
142        &self.testing_information
143    }
144    /// <p>The title of the action plan for remediating the control.</p>
145    pub fn action_plan_title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.action_plan_title = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The title of the action plan for remediating the control.</p>
150    pub fn set_action_plan_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.action_plan_title = input;
152        self
153    }
154    /// <p>The title of the action plan for remediating the control.</p>
155    pub fn get_action_plan_title(&self) -> &::std::option::Option<::std::string::String> {
156        &self.action_plan_title
157    }
158    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
159    pub fn action_plan_instructions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.action_plan_instructions = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
164    pub fn set_action_plan_instructions(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.action_plan_instructions = input;
166        self
167    }
168    /// <p>The recommended actions to carry out if the control isn't fulfilled.</p>
169    pub fn get_action_plan_instructions(&self) -> &::std::option::Option<::std::string::String> {
170        &self.action_plan_instructions
171    }
172    /// Appends an item to `control_mapping_sources`.
173    ///
174    /// To override the contents of this collection use [`set_control_mapping_sources`](Self::set_control_mapping_sources).
175    ///
176    /// <p>The data mapping sources for the control.</p>
177    pub fn control_mapping_sources(mut self, input: crate::types::ControlMappingSource) -> Self {
178        let mut v = self.control_mapping_sources.unwrap_or_default();
179        v.push(input);
180        self.control_mapping_sources = ::std::option::Option::Some(v);
181        self
182    }
183    /// <p>The data mapping sources for the control.</p>
184    pub fn set_control_mapping_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>) -> Self {
185        self.control_mapping_sources = input;
186        self
187    }
188    /// <p>The data mapping sources for the control.</p>
189    pub fn get_control_mapping_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>> {
190        &self.control_mapping_sources
191    }
192    /// Consumes the builder and constructs a [`UpdateControlInput`](crate::operation::update_control::UpdateControlInput).
193    pub fn build(
194        self,
195    ) -> ::std::result::Result<crate::operation::update_control::UpdateControlInput, ::aws_smithy_types::error::operation::BuildError> {
196        ::std::result::Result::Ok(crate::operation::update_control::UpdateControlInput {
197            control_id: self.control_id,
198            name: self.name,
199            description: self.description,
200            testing_information: self.testing_information,
201            action_plan_title: self.action_plan_title,
202            action_plan_instructions: self.action_plan_instructions,
203            control_mapping_sources: self.control_mapping_sources,
204        })
205    }
206}
207impl ::std::fmt::Debug for UpdateControlInputBuilder {
208    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
209        let mut formatter = f.debug_struct("UpdateControlInputBuilder");
210        formatter.field("control_id", &self.control_id);
211        formatter.field("name", &self.name);
212        formatter.field("description", &"*** Sensitive Data Redacted ***");
213        formatter.field("testing_information", &"*** Sensitive Data Redacted ***");
214        formatter.field("action_plan_title", &"*** Sensitive Data Redacted ***");
215        formatter.field("action_plan_instructions", &"*** Sensitive Data Redacted ***");
216        formatter.field("control_mapping_sources", &self.control_mapping_sources);
217        formatter.finish()
218    }
219}