aws_sdk_auditmanager/types/
_control.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct Control {
7 pub arn: ::std::option::Option<::std::string::String>,
9 pub id: ::std::option::Option<::std::string::String>,
11 pub r#type: ::std::option::Option<crate::types::ControlType>,
13 pub name: ::std::option::Option<::std::string::String>,
15 pub description: ::std::option::Option<::std::string::String>,
17 pub testing_information: ::std::option::Option<::std::string::String>,
19 pub action_plan_title: ::std::option::Option<::std::string::String>,
21 pub action_plan_instructions: ::std::option::Option<::std::string::String>,
23 pub control_sources: ::std::option::Option<::std::string::String>,
25 pub control_mapping_sources: ::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>>,
27 pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
29 pub last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
31 pub created_by: ::std::option::Option<::std::string::String>,
33 pub last_updated_by: ::std::option::Option<::std::string::String>,
35 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37 pub state: ::std::option::Option<crate::types::ControlState>,
39}
40impl Control {
41 pub fn arn(&self) -> ::std::option::Option<&str> {
43 self.arn.as_deref()
44 }
45 pub fn id(&self) -> ::std::option::Option<&str> {
47 self.id.as_deref()
48 }
49 pub fn r#type(&self) -> ::std::option::Option<&crate::types::ControlType> {
51 self.r#type.as_ref()
52 }
53 pub fn name(&self) -> ::std::option::Option<&str> {
55 self.name.as_deref()
56 }
57 pub fn description(&self) -> ::std::option::Option<&str> {
59 self.description.as_deref()
60 }
61 pub fn testing_information(&self) -> ::std::option::Option<&str> {
63 self.testing_information.as_deref()
64 }
65 pub fn action_plan_title(&self) -> ::std::option::Option<&str> {
67 self.action_plan_title.as_deref()
68 }
69 pub fn action_plan_instructions(&self) -> ::std::option::Option<&str> {
71 self.action_plan_instructions.as_deref()
72 }
73 pub fn control_sources(&self) -> ::std::option::Option<&str> {
75 self.control_sources.as_deref()
76 }
77 pub fn control_mapping_sources(&self) -> &[crate::types::ControlMappingSource] {
81 self.control_mapping_sources.as_deref().unwrap_or_default()
82 }
83 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
85 self.created_at.as_ref()
86 }
87 pub fn last_updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
89 self.last_updated_at.as_ref()
90 }
91 pub fn created_by(&self) -> ::std::option::Option<&str> {
93 self.created_by.as_deref()
94 }
95 pub fn last_updated_by(&self) -> ::std::option::Option<&str> {
97 self.last_updated_by.as_deref()
98 }
99 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
101 self.tags.as_ref()
102 }
103 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 pub fn builder() -> crate::types::builders::ControlBuilder {
133 crate::types::builders::ControlBuilder::default()
134 }
135}
136
137#[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 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.arn = input;
167 self
168 }
169 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
171 &self.arn
172 }
173 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.id = input;
181 self
182 }
183 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
185 &self.id
186 }
187 pub fn r#type(mut self, input: crate::types::ControlType) -> Self {
189 self.r#type = ::std::option::Option::Some(input);
190 self
191 }
192 pub fn set_type(mut self, input: ::std::option::Option<crate::types::ControlType>) -> Self {
194 self.r#type = input;
195 self
196 }
197 pub fn get_type(&self) -> &::std::option::Option<crate::types::ControlType> {
199 &self.r#type
200 }
201 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
208 self.name = input;
209 self
210 }
211 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
213 &self.name
214 }
215 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.description = input;
223 self
224 }
225 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
227 &self.description
228 }
229 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 pub fn set_testing_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236 self.testing_information = input;
237 self
238 }
239 pub fn get_testing_information(&self) -> &::std::option::Option<::std::string::String> {
241 &self.testing_information
242 }
243 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 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 pub fn get_action_plan_title(&self) -> &::std::option::Option<::std::string::String> {
255 &self.action_plan_title
256 }
257 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 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 pub fn get_action_plan_instructions(&self) -> &::std::option::Option<::std::string::String> {
269 &self.action_plan_instructions
270 }
271 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 pub fn set_control_sources(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278 self.control_sources = input;
279 self
280 }
281 pub fn get_control_sources(&self) -> &::std::option::Option<::std::string::String> {
283 &self.control_sources
284 }
285 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 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 pub fn get_control_mapping_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ControlMappingSource>> {
303 &self.control_mapping_sources
304 }
305 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
317 &self.created_at
318 }
319 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 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 pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
331 &self.last_updated_at
332 }
333 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
340 self.created_by = input;
341 self
342 }
343 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
345 &self.created_by
346 }
347 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 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 pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
359 &self.last_updated_by
360 }
361 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
379 &self.tags
380 }
381 pub fn state(mut self, input: crate::types::ControlState) -> Self {
383 self.state = ::std::option::Option::Some(input);
384 self
385 }
386 pub fn set_state(mut self, input: ::std::option::Option<crate::types::ControlState>) -> Self {
388 self.state = input;
389 self
390 }
391 pub fn get_state(&self) -> &::std::option::Option<crate::types::ControlState> {
393 &self.state
394 }
395 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}