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