aws_sdk_wellarchitected/operation/update_answer/_update_answer_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Input to update answer.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateAnswerInput {
7 /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
8 pub workload_id: ::std::option::Option<::std::string::String>,
9 /// <p>The alias of the lens.</p>
10 /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
11 /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
12 /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
13 pub lens_alias: ::std::option::Option<::std::string::String>,
14 /// <p>The ID of the question.</p>
15 pub question_id: ::std::option::Option<::std::string::String>,
16 /// <p>List of selected choice IDs in a question answer.</p>
17 /// <p>The values entered replace the previously selected choices.</p>
18 pub selected_choices: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19 /// <p>A list of choices to update on a question in your workload. The String key corresponds to the choice ID to be updated.</p>
20 pub choice_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>>,
21 /// <p>The notes associated with the workload.</p>
22 /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
23 pub notes: ::std::option::Option<::std::string::String>,
24 /// <p>Defines whether this question is applicable to a lens review.</p>
25 pub is_applicable: ::std::option::Option<bool>,
26 /// <p>The reason why a question is not applicable to your workload.</p>
27 pub reason: ::std::option::Option<crate::types::AnswerReason>,
28}
29impl UpdateAnswerInput {
30 /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
31 pub fn workload_id(&self) -> ::std::option::Option<&str> {
32 self.workload_id.as_deref()
33 }
34 /// <p>The alias of the lens.</p>
35 /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
36 /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
37 /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
38 pub fn lens_alias(&self) -> ::std::option::Option<&str> {
39 self.lens_alias.as_deref()
40 }
41 /// <p>The ID of the question.</p>
42 pub fn question_id(&self) -> ::std::option::Option<&str> {
43 self.question_id.as_deref()
44 }
45 /// <p>List of selected choice IDs in a question answer.</p>
46 /// <p>The values entered replace the previously selected choices.</p>
47 ///
48 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.selected_choices.is_none()`.
49 pub fn selected_choices(&self) -> &[::std::string::String] {
50 self.selected_choices.as_deref().unwrap_or_default()
51 }
52 /// <p>A list of choices to update on a question in your workload. The String key corresponds to the choice ID to be updated.</p>
53 pub fn choice_updates(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>> {
54 self.choice_updates.as_ref()
55 }
56 /// <p>The notes associated with the workload.</p>
57 /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
58 pub fn notes(&self) -> ::std::option::Option<&str> {
59 self.notes.as_deref()
60 }
61 /// <p>Defines whether this question is applicable to a lens review.</p>
62 pub fn is_applicable(&self) -> ::std::option::Option<bool> {
63 self.is_applicable
64 }
65 /// <p>The reason why a question is not applicable to your workload.</p>
66 pub fn reason(&self) -> ::std::option::Option<&crate::types::AnswerReason> {
67 self.reason.as_ref()
68 }
69}
70impl UpdateAnswerInput {
71 /// Creates a new builder-style object to manufacture [`UpdateAnswerInput`](crate::operation::update_answer::UpdateAnswerInput).
72 pub fn builder() -> crate::operation::update_answer::builders::UpdateAnswerInputBuilder {
73 crate::operation::update_answer::builders::UpdateAnswerInputBuilder::default()
74 }
75}
76
77/// A builder for [`UpdateAnswerInput`](crate::operation::update_answer::UpdateAnswerInput).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct UpdateAnswerInputBuilder {
81 pub(crate) workload_id: ::std::option::Option<::std::string::String>,
82 pub(crate) lens_alias: ::std::option::Option<::std::string::String>,
83 pub(crate) question_id: ::std::option::Option<::std::string::String>,
84 pub(crate) selected_choices: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
85 pub(crate) choice_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>>,
86 pub(crate) notes: ::std::option::Option<::std::string::String>,
87 pub(crate) is_applicable: ::std::option::Option<bool>,
88 pub(crate) reason: ::std::option::Option<crate::types::AnswerReason>,
89}
90impl UpdateAnswerInputBuilder {
91 /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
92 /// This field is required.
93 pub fn workload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94 self.workload_id = ::std::option::Option::Some(input.into());
95 self
96 }
97 /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
98 pub fn set_workload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.workload_id = input;
100 self
101 }
102 /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
103 pub fn get_workload_id(&self) -> &::std::option::Option<::std::string::String> {
104 &self.workload_id
105 }
106 /// <p>The alias of the lens.</p>
107 /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
108 /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
109 /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
110 /// This field is required.
111 pub fn lens_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.lens_alias = ::std::option::Option::Some(input.into());
113 self
114 }
115 /// <p>The alias of the lens.</p>
116 /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
117 /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
118 /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
119 pub fn set_lens_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.lens_alias = input;
121 self
122 }
123 /// <p>The alias of the lens.</p>
124 /// <p>For Amazon Web Services official lenses, this is either the lens alias, such as <code>serverless</code>, or the lens ARN, such as <code>arn:aws:wellarchitected:us-east-1::lens/serverless</code>. Note that some operations (such as ExportLens and CreateLensShare) are not permitted on Amazon Web Services official lenses.</p>
125 /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
126 /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
127 pub fn get_lens_alias(&self) -> &::std::option::Option<::std::string::String> {
128 &self.lens_alias
129 }
130 /// <p>The ID of the question.</p>
131 /// This field is required.
132 pub fn question_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.question_id = ::std::option::Option::Some(input.into());
134 self
135 }
136 /// <p>The ID of the question.</p>
137 pub fn set_question_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.question_id = input;
139 self
140 }
141 /// <p>The ID of the question.</p>
142 pub fn get_question_id(&self) -> &::std::option::Option<::std::string::String> {
143 &self.question_id
144 }
145 /// Appends an item to `selected_choices`.
146 ///
147 /// To override the contents of this collection use [`set_selected_choices`](Self::set_selected_choices).
148 ///
149 /// <p>List of selected choice IDs in a question answer.</p>
150 /// <p>The values entered replace the previously selected choices.</p>
151 pub fn selected_choices(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 let mut v = self.selected_choices.unwrap_or_default();
153 v.push(input.into());
154 self.selected_choices = ::std::option::Option::Some(v);
155 self
156 }
157 /// <p>List of selected choice IDs in a question answer.</p>
158 /// <p>The values entered replace the previously selected choices.</p>
159 pub fn set_selected_choices(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
160 self.selected_choices = input;
161 self
162 }
163 /// <p>List of selected choice IDs in a question answer.</p>
164 /// <p>The values entered replace the previously selected choices.</p>
165 pub fn get_selected_choices(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
166 &self.selected_choices
167 }
168 /// Adds a key-value pair to `choice_updates`.
169 ///
170 /// To override the contents of this collection use [`set_choice_updates`](Self::set_choice_updates).
171 ///
172 /// <p>A list of choices to update on a question in your workload. The String key corresponds to the choice ID to be updated.</p>
173 pub fn choice_updates(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ChoiceUpdate) -> Self {
174 let mut hash_map = self.choice_updates.unwrap_or_default();
175 hash_map.insert(k.into(), v);
176 self.choice_updates = ::std::option::Option::Some(hash_map);
177 self
178 }
179 /// <p>A list of choices to update on a question in your workload. The String key corresponds to the choice ID to be updated.</p>
180 pub fn set_choice_updates(
181 mut self,
182 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>>,
183 ) -> Self {
184 self.choice_updates = input;
185 self
186 }
187 /// <p>A list of choices to update on a question in your workload. The String key corresponds to the choice ID to be updated.</p>
188 pub fn get_choice_updates(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>> {
189 &self.choice_updates
190 }
191 /// <p>The notes associated with the workload.</p>
192 /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
193 pub fn notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194 self.notes = ::std::option::Option::Some(input.into());
195 self
196 }
197 /// <p>The notes associated with the workload.</p>
198 /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
199 pub fn set_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200 self.notes = input;
201 self
202 }
203 /// <p>The notes associated with the workload.</p>
204 /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
205 pub fn get_notes(&self) -> &::std::option::Option<::std::string::String> {
206 &self.notes
207 }
208 /// <p>Defines whether this question is applicable to a lens review.</p>
209 pub fn is_applicable(mut self, input: bool) -> Self {
210 self.is_applicable = ::std::option::Option::Some(input);
211 self
212 }
213 /// <p>Defines whether this question is applicable to a lens review.</p>
214 pub fn set_is_applicable(mut self, input: ::std::option::Option<bool>) -> Self {
215 self.is_applicable = input;
216 self
217 }
218 /// <p>Defines whether this question is applicable to a lens review.</p>
219 pub fn get_is_applicable(&self) -> &::std::option::Option<bool> {
220 &self.is_applicable
221 }
222 /// <p>The reason why a question is not applicable to your workload.</p>
223 pub fn reason(mut self, input: crate::types::AnswerReason) -> Self {
224 self.reason = ::std::option::Option::Some(input);
225 self
226 }
227 /// <p>The reason why a question is not applicable to your workload.</p>
228 pub fn set_reason(mut self, input: ::std::option::Option<crate::types::AnswerReason>) -> Self {
229 self.reason = input;
230 self
231 }
232 /// <p>The reason why a question is not applicable to your workload.</p>
233 pub fn get_reason(&self) -> &::std::option::Option<crate::types::AnswerReason> {
234 &self.reason
235 }
236 /// Consumes the builder and constructs a [`UpdateAnswerInput`](crate::operation::update_answer::UpdateAnswerInput).
237 pub fn build(
238 self,
239 ) -> ::std::result::Result<crate::operation::update_answer::UpdateAnswerInput, ::aws_smithy_types::error::operation::BuildError> {
240 ::std::result::Result::Ok(crate::operation::update_answer::UpdateAnswerInput {
241 workload_id: self.workload_id,
242 lens_alias: self.lens_alias,
243 question_id: self.question_id,
244 selected_choices: self.selected_choices,
245 choice_updates: self.choice_updates,
246 notes: self.notes,
247 is_applicable: self.is_applicable,
248 reason: self.reason,
249 })
250 }
251}