aws_sdk_auditmanager/operation/create_control/
_create_control_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateControlInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub testing_information: ::std::option::Option<::std::string::String>,
12 pub action_plan_title: ::std::option::Option<::std::string::String>,
14 pub action_plan_instructions: ::std::option::Option<::std::string::String>,
16 pub control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::CreateControlMappingSource>>,
18 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20}
21impl CreateControlInput {
22 pub fn name(&self) -> ::std::option::Option<&str> {
24 self.name.as_deref()
25 }
26 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 pub fn testing_information(&self) -> ::std::option::Option<&str> {
32 self.testing_information.as_deref()
33 }
34 pub fn action_plan_title(&self) -> ::std::option::Option<&str> {
36 self.action_plan_title.as_deref()
37 }
38 pub fn action_plan_instructions(&self) -> ::std::option::Option<&str> {
40 self.action_plan_instructions.as_deref()
41 }
42 pub fn control_mapping_sources(&self) -> &[crate::types::CreateControlMappingSource] {
46 self.control_mapping_sources.as_deref().unwrap_or_default()
47 }
48 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 pub fn builder() -> crate::operation::create_control::builders::CreateControlInputBuilder {
69 crate::operation::create_control::builders::CreateControlInputBuilder::default()
70 }
71}
72
73#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.name = input;
95 self
96 }
97 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
99 &self.name
100 }
101 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.description = input;
109 self
110 }
111 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
113 &self.description
114 }
115 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 pub fn set_testing_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.testing_information = input;
123 self
124 }
125 pub fn get_testing_information(&self) -> &::std::option::Option<::std::string::String> {
127 &self.testing_information
128 }
129 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 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 pub fn get_action_plan_title(&self) -> &::std::option::Option<::std::string::String> {
141 &self.action_plan_title
142 }
143 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 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 pub fn get_action_plan_instructions(&self) -> &::std::option::Option<::std::string::String> {
155 &self.action_plan_instructions
156 }
157 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 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 pub fn get_control_mapping_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CreateControlMappingSource>> {
175 &self.control_mapping_sources
176 }
177 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195 &self.tags
196 }
197 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}