aws_sdk_auditmanager/operation/update_assessment/
_update_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 UpdateAssessmentInput {
6    /// <p>The unique identifier for the assessment.</p>
7    pub assessment_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the assessment to be updated.</p>
9    pub assessment_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the assessment.</p>
11    pub assessment_description: ::std::option::Option<::std::string::String>,
12    /// <p>The scope of the assessment.</p>
13    pub scope: ::std::option::Option<crate::types::Scope>,
14    /// <p>The assessment report storage destination for the assessment that's being updated.</p>
15    pub assessment_reports_destination: ::std::option::Option<crate::types::AssessmentReportsDestination>,
16    /// <p>The list of roles for the assessment.</p>
17    pub roles: ::std::option::Option<::std::vec::Vec<crate::types::Role>>,
18}
19impl UpdateAssessmentInput {
20    /// <p>The unique identifier for the assessment.</p>
21    pub fn assessment_id(&self) -> ::std::option::Option<&str> {
22        self.assessment_id.as_deref()
23    }
24    /// <p>The name of the assessment to be updated.</p>
25    pub fn assessment_name(&self) -> ::std::option::Option<&str> {
26        self.assessment_name.as_deref()
27    }
28    /// <p>The description of the assessment.</p>
29    pub fn assessment_description(&self) -> ::std::option::Option<&str> {
30        self.assessment_description.as_deref()
31    }
32    /// <p>The scope of the assessment.</p>
33    pub fn scope(&self) -> ::std::option::Option<&crate::types::Scope> {
34        self.scope.as_ref()
35    }
36    /// <p>The assessment report storage destination for the assessment that's being updated.</p>
37    pub fn assessment_reports_destination(&self) -> ::std::option::Option<&crate::types::AssessmentReportsDestination> {
38        self.assessment_reports_destination.as_ref()
39    }
40    /// <p>The list of roles for the assessment.</p>
41    ///
42    /// 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()`.
43    pub fn roles(&self) -> &[crate::types::Role] {
44        self.roles.as_deref().unwrap_or_default()
45    }
46}
47impl ::std::fmt::Debug for UpdateAssessmentInput {
48    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
49        let mut formatter = f.debug_struct("UpdateAssessmentInput");
50        formatter.field("assessment_id", &self.assessment_id);
51        formatter.field("assessment_name", &"*** Sensitive Data Redacted ***");
52        formatter.field("assessment_description", &"*** Sensitive Data Redacted ***");
53        formatter.field("scope", &"*** Sensitive Data Redacted ***");
54        formatter.field("assessment_reports_destination", &"*** Sensitive Data Redacted ***");
55        formatter.field("roles", &"*** Sensitive Data Redacted ***");
56        formatter.finish()
57    }
58}
59impl UpdateAssessmentInput {
60    /// Creates a new builder-style object to manufacture [`UpdateAssessmentInput`](crate::operation::update_assessment::UpdateAssessmentInput).
61    pub fn builder() -> crate::operation::update_assessment::builders::UpdateAssessmentInputBuilder {
62        crate::operation::update_assessment::builders::UpdateAssessmentInputBuilder::default()
63    }
64}
65
66/// A builder for [`UpdateAssessmentInput`](crate::operation::update_assessment::UpdateAssessmentInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
68#[non_exhaustive]
69pub struct UpdateAssessmentInputBuilder {
70    pub(crate) assessment_id: ::std::option::Option<::std::string::String>,
71    pub(crate) assessment_name: ::std::option::Option<::std::string::String>,
72    pub(crate) assessment_description: ::std::option::Option<::std::string::String>,
73    pub(crate) scope: ::std::option::Option<crate::types::Scope>,
74    pub(crate) assessment_reports_destination: ::std::option::Option<crate::types::AssessmentReportsDestination>,
75    pub(crate) roles: ::std::option::Option<::std::vec::Vec<crate::types::Role>>,
76}
77impl UpdateAssessmentInputBuilder {
78    /// <p>The unique identifier for the assessment.</p>
79    /// This field is required.
80    pub fn assessment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.assessment_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The unique identifier for the assessment.</p>
85    pub fn set_assessment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.assessment_id = input;
87        self
88    }
89    /// <p>The unique identifier for the assessment.</p>
90    pub fn get_assessment_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.assessment_id
92    }
93    /// <p>The name of the assessment to be updated.</p>
94    pub fn assessment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.assessment_name = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The name of the assessment to be updated.</p>
99    pub fn set_assessment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.assessment_name = input;
101        self
102    }
103    /// <p>The name of the assessment to be updated.</p>
104    pub fn get_assessment_name(&self) -> &::std::option::Option<::std::string::String> {
105        &self.assessment_name
106    }
107    /// <p>The description of the assessment.</p>
108    pub fn assessment_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.assessment_description = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The description of the assessment.</p>
113    pub fn set_assessment_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.assessment_description = input;
115        self
116    }
117    /// <p>The description of the assessment.</p>
118    pub fn get_assessment_description(&self) -> &::std::option::Option<::std::string::String> {
119        &self.assessment_description
120    }
121    /// <p>The scope of the assessment.</p>
122    /// This field is required.
123    pub fn scope(mut self, input: crate::types::Scope) -> Self {
124        self.scope = ::std::option::Option::Some(input);
125        self
126    }
127    /// <p>The scope of the assessment.</p>
128    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
129        self.scope = input;
130        self
131    }
132    /// <p>The scope of the assessment.</p>
133    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
134        &self.scope
135    }
136    /// <p>The assessment report storage destination for the assessment that's being updated.</p>
137    pub fn assessment_reports_destination(mut self, input: crate::types::AssessmentReportsDestination) -> Self {
138        self.assessment_reports_destination = ::std::option::Option::Some(input);
139        self
140    }
141    /// <p>The assessment report storage destination for the assessment that's being updated.</p>
142    pub fn set_assessment_reports_destination(mut self, input: ::std::option::Option<crate::types::AssessmentReportsDestination>) -> Self {
143        self.assessment_reports_destination = input;
144        self
145    }
146    /// <p>The assessment report storage destination for the assessment that's being updated.</p>
147    pub fn get_assessment_reports_destination(&self) -> &::std::option::Option<crate::types::AssessmentReportsDestination> {
148        &self.assessment_reports_destination
149    }
150    /// Appends an item to `roles`.
151    ///
152    /// To override the contents of this collection use [`set_roles`](Self::set_roles).
153    ///
154    /// <p>The list of roles for the assessment.</p>
155    pub fn roles(mut self, input: crate::types::Role) -> Self {
156        let mut v = self.roles.unwrap_or_default();
157        v.push(input);
158        self.roles = ::std::option::Option::Some(v);
159        self
160    }
161    /// <p>The list of roles for the assessment.</p>
162    pub fn set_roles(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Role>>) -> Self {
163        self.roles = input;
164        self
165    }
166    /// <p>The list of roles for the assessment.</p>
167    pub fn get_roles(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Role>> {
168        &self.roles
169    }
170    /// Consumes the builder and constructs a [`UpdateAssessmentInput`](crate::operation::update_assessment::UpdateAssessmentInput).
171    pub fn build(
172        self,
173    ) -> ::std::result::Result<crate::operation::update_assessment::UpdateAssessmentInput, ::aws_smithy_types::error::operation::BuildError> {
174        ::std::result::Result::Ok(crate::operation::update_assessment::UpdateAssessmentInput {
175            assessment_id: self.assessment_id,
176            assessment_name: self.assessment_name,
177            assessment_description: self.assessment_description,
178            scope: self.scope,
179            assessment_reports_destination: self.assessment_reports_destination,
180            roles: self.roles,
181        })
182    }
183}
184impl ::std::fmt::Debug for UpdateAssessmentInputBuilder {
185    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
186        let mut formatter = f.debug_struct("UpdateAssessmentInputBuilder");
187        formatter.field("assessment_id", &self.assessment_id);
188        formatter.field("assessment_name", &"*** Sensitive Data Redacted ***");
189        formatter.field("assessment_description", &"*** Sensitive Data Redacted ***");
190        formatter.field("scope", &"*** Sensitive Data Redacted ***");
191        formatter.field("assessment_reports_destination", &"*** Sensitive Data Redacted ***");
192        formatter.field("roles", &"*** Sensitive Data Redacted ***");
193        formatter.finish()
194    }
195}