aws_sdk_auditmanager/operation/create_assessment/
_create_assessment_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 CreateAssessmentInput {
6    /// <p>The name of the assessment to be created.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The optional description of the assessment to be created.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The assessment report storage destination for the assessment that's being created.</p>
11    pub assessment_reports_destination: ::std::option::Option<crate::types::AssessmentReportsDestination>,
12    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
13    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
14    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
15    /// </note>
16    pub scope: ::std::option::Option<crate::types::Scope>,
17    /// <p>The list of roles for the assessment.</p>
18    pub roles: ::std::option::Option<::std::vec::Vec<crate::types::Role>>,
19    /// <p>The identifier for the framework that the assessment will be created from.</p>
20    pub framework_id: ::std::option::Option<::std::string::String>,
21    /// <p>The tags that are associated with the assessment.</p>
22    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
23}
24impl CreateAssessmentInput {
25    /// <p>The name of the assessment to be created.</p>
26    pub fn name(&self) -> ::std::option::Option<&str> {
27        self.name.as_deref()
28    }
29    /// <p>The optional description of the assessment to be created.</p>
30    pub fn description(&self) -> ::std::option::Option<&str> {
31        self.description.as_deref()
32    }
33    /// <p>The assessment report storage destination for the assessment that's being created.</p>
34    pub fn assessment_reports_destination(&self) -> ::std::option::Option<&crate::types::AssessmentReportsDestination> {
35        self.assessment_reports_destination.as_ref()
36    }
37    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
38    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
39    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
40    /// </note>
41    pub fn scope(&self) -> ::std::option::Option<&crate::types::Scope> {
42        self.scope.as_ref()
43    }
44    /// <p>The list of roles for the assessment.</p>
45    ///
46    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.roles.is_none()`.
47    pub fn roles(&self) -> &[crate::types::Role] {
48        self.roles.as_deref().unwrap_or_default()
49    }
50    /// <p>The identifier for the framework that the assessment will be created from.</p>
51    pub fn framework_id(&self) -> ::std::option::Option<&str> {
52        self.framework_id.as_deref()
53    }
54    /// <p>The tags that are associated with the assessment.</p>
55    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
56        self.tags.as_ref()
57    }
58}
59impl ::std::fmt::Debug for CreateAssessmentInput {
60    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
61        let mut formatter = f.debug_struct("CreateAssessmentInput");
62        formatter.field("name", &"*** Sensitive Data Redacted ***");
63        formatter.field("description", &"*** Sensitive Data Redacted ***");
64        formatter.field("assessment_reports_destination", &"*** Sensitive Data Redacted ***");
65        formatter.field("scope", &"*** Sensitive Data Redacted ***");
66        formatter.field("roles", &"*** Sensitive Data Redacted ***");
67        formatter.field("framework_id", &self.framework_id);
68        formatter.field("tags", &self.tags);
69        formatter.finish()
70    }
71}
72impl CreateAssessmentInput {
73    /// Creates a new builder-style object to manufacture [`CreateAssessmentInput`](crate::operation::create_assessment::CreateAssessmentInput).
74    pub fn builder() -> crate::operation::create_assessment::builders::CreateAssessmentInputBuilder {
75        crate::operation::create_assessment::builders::CreateAssessmentInputBuilder::default()
76    }
77}
78
79/// A builder for [`CreateAssessmentInput`](crate::operation::create_assessment::CreateAssessmentInput).
80#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
81#[non_exhaustive]
82pub struct CreateAssessmentInputBuilder {
83    pub(crate) name: ::std::option::Option<::std::string::String>,
84    pub(crate) description: ::std::option::Option<::std::string::String>,
85    pub(crate) assessment_reports_destination: ::std::option::Option<crate::types::AssessmentReportsDestination>,
86    pub(crate) scope: ::std::option::Option<crate::types::Scope>,
87    pub(crate) roles: ::std::option::Option<::std::vec::Vec<crate::types::Role>>,
88    pub(crate) framework_id: ::std::option::Option<::std::string::String>,
89    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
90}
91impl CreateAssessmentInputBuilder {
92    /// <p>The name of the assessment to be created.</p>
93    /// This field is required.
94    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.name = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The name of the assessment to be created.</p>
99    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.name = input;
101        self
102    }
103    /// <p>The name of the assessment to be created.</p>
104    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
105        &self.name
106    }
107    /// <p>The optional description of the assessment to be created.</p>
108    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.description = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The optional description of the assessment to be created.</p>
113    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.description = input;
115        self
116    }
117    /// <p>The optional description of the assessment to be created.</p>
118    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
119        &self.description
120    }
121    /// <p>The assessment report storage destination for the assessment that's being created.</p>
122    /// This field is required.
123    pub fn assessment_reports_destination(mut self, input: crate::types::AssessmentReportsDestination) -> Self {
124        self.assessment_reports_destination = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>The assessment report storage destination for the assessment that's being created.</p>
128    pub fn set_assessment_reports_destination(mut self, input: ::std::option::Option<crate::types::AssessmentReportsDestination>) -> Self {
129        self.assessment_reports_destination = input;
130        self
131    }
132    /// <p>The assessment report storage destination for the assessment that's being created.</p>
133    pub fn get_assessment_reports_destination(&self) -> &::std::option::Option<crate::types::AssessmentReportsDestination> {
134        &self.assessment_reports_destination
135    }
136    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
137    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
138    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
139    /// </note>
140    /// This field is required.
141    pub fn scope(mut self, input: crate::types::Scope) -> Self {
142        self.scope = ::std::option::Option::Some(input);
143        self
144    }
145    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
146    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
147    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
148    /// </note>
149    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
150        self.scope = input;
151        self
152    }
153    /// <p>The wrapper that contains the Amazon Web Services accounts that are in scope for the assessment.</p><note>
154    /// <p>You no longer need to specify which Amazon Web Services services are in scope when you create or update an assessment. Audit Manager infers the services in scope by examining your assessment controls and their data sources, and then mapping this information to the relevant Amazon Web Services services.</p>
155    /// <p>If an underlying data source changes for your assessment, we automatically update the services scope as needed to reflect the correct Amazon Web Services services. This ensures that your assessment collects accurate and comprehensive evidence about all of the relevant services in your AWS environment.</p>
156    /// </note>
157    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
158        &self.scope
159    }
160    /// Appends an item to `roles`.
161    ///
162    /// To override the contents of this collection use [`set_roles`](Self::set_roles).
163    ///
164    /// <p>The list of roles for the assessment.</p>
165    pub fn roles(mut self, input: crate::types::Role) -> Self {
166        let mut v = self.roles.unwrap_or_default();
167        v.push(input);
168        self.roles = ::std::option::Option::Some(v);
169        self
170    }
171    /// <p>The list of roles for the assessment.</p>
172    pub fn set_roles(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Role>>) -> Self {
173        self.roles = input;
174        self
175    }
176    /// <p>The list of roles for the assessment.</p>
177    pub fn get_roles(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Role>> {
178        &self.roles
179    }
180    /// <p>The identifier for the framework that the assessment will be created from.</p>
181    /// This field is required.
182    pub fn framework_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.framework_id = ::std::option::Option::Some(input.into());
184        self
185    }
186    /// <p>The identifier for the framework that the assessment will be created from.</p>
187    pub fn set_framework_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.framework_id = input;
189        self
190    }
191    /// <p>The identifier for the framework that the assessment will be created from.</p>
192    pub fn get_framework_id(&self) -> &::std::option::Option<::std::string::String> {
193        &self.framework_id
194    }
195    /// Adds a key-value pair to `tags`.
196    ///
197    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
198    ///
199    /// <p>The tags that are associated with the assessment.</p>
200    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
201        let mut hash_map = self.tags.unwrap_or_default();
202        hash_map.insert(k.into(), v.into());
203        self.tags = ::std::option::Option::Some(hash_map);
204        self
205    }
206    /// <p>The tags that are associated with the assessment.</p>
207    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
208        self.tags = input;
209        self
210    }
211    /// <p>The tags that are associated with the assessment.</p>
212    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
213        &self.tags
214    }
215    /// Consumes the builder and constructs a [`CreateAssessmentInput`](crate::operation::create_assessment::CreateAssessmentInput).
216    pub fn build(
217        self,
218    ) -> ::std::result::Result<crate::operation::create_assessment::CreateAssessmentInput, ::aws_smithy_types::error::operation::BuildError> {
219        ::std::result::Result::Ok(crate::operation::create_assessment::CreateAssessmentInput {
220            name: self.name,
221            description: self.description,
222            assessment_reports_destination: self.assessment_reports_destination,
223            scope: self.scope,
224            roles: self.roles,
225            framework_id: self.framework_id,
226            tags: self.tags,
227        })
228    }
229}
230impl ::std::fmt::Debug for CreateAssessmentInputBuilder {
231    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
232        let mut formatter = f.debug_struct("CreateAssessmentInputBuilder");
233        formatter.field("name", &"*** Sensitive Data Redacted ***");
234        formatter.field("description", &"*** Sensitive Data Redacted ***");
235        formatter.field("assessment_reports_destination", &"*** Sensitive Data Redacted ***");
236        formatter.field("scope", &"*** Sensitive Data Redacted ***");
237        formatter.field("roles", &"*** Sensitive Data Redacted ***");
238        formatter.field("framework_id", &self.framework_id);
239        formatter.field("tags", &self.tags);
240        formatter.finish()
241    }
242}