aws_sdk_wellarchitected/operation/update_answer/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_answer::_update_answer_output::UpdateAnswerOutputBuilder;
3
4pub use crate::operation::update_answer::_update_answer_input::UpdateAnswerInputBuilder;
5
6impl crate::operation::update_answer::builders::UpdateAnswerInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_answer::UpdateAnswerOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_answer::UpdateAnswerError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_answer();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAnswer`.
24///
25/// <p>Update the answer to a specific question in a workload review.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAnswerFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_answer::builders::UpdateAnswerInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_answer::UpdateAnswerOutput,
35        crate::operation::update_answer::UpdateAnswerError,
36    > for UpdateAnswerFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_answer::UpdateAnswerOutput,
44            crate::operation::update_answer::UpdateAnswerError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateAnswerFluentBuilder {
51    /// Creates a new `UpdateAnswerFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateAnswer as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_answer::builders::UpdateAnswerInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_answer::UpdateAnswerOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_answer::UpdateAnswerError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_answer::UpdateAnswer::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_answer::UpdateAnswer::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_answer::UpdateAnswerOutput,
97        crate::operation::update_answer::UpdateAnswerError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
112    pub fn workload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.workload_id(input.into());
114        self
115    }
116    /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
117    pub fn set_workload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_workload_id(input);
119        self
120    }
121    /// <p>The ID assigned to the workload. This ID is unique within an Amazon Web Services Region.</p>
122    pub fn get_workload_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_workload_id()
124    }
125    /// <p>The alias of the lens.</p>
126    /// <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>
127    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
128    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
129    pub fn lens_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.lens_alias(input.into());
131        self
132    }
133    /// <p>The alias of the lens.</p>
134    /// <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>
135    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
136    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
137    pub fn set_lens_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_lens_alias(input);
139        self
140    }
141    /// <p>The alias of the lens.</p>
142    /// <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>
143    /// <p>For custom lenses, this is the lens ARN, such as <code>arn:aws:wellarchitected:us-west-2:123456789012:lens/0123456789abcdef01234567890abcdef</code>.</p>
144    /// <p>Each lens is identified by its <code>LensSummary$LensAlias</code>.</p>
145    pub fn get_lens_alias(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_lens_alias()
147    }
148    /// <p>The ID of the question.</p>
149    pub fn question_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.question_id(input.into());
151        self
152    }
153    /// <p>The ID of the question.</p>
154    pub fn set_question_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_question_id(input);
156        self
157    }
158    /// <p>The ID of the question.</p>
159    pub fn get_question_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_question_id()
161    }
162    ///
163    /// Appends an item to `SelectedChoices`.
164    ///
165    /// To override the contents of this collection use [`set_selected_choices`](Self::set_selected_choices).
166    ///
167    /// <p>List of selected choice IDs in a question answer.</p>
168    /// <p>The values entered replace the previously selected choices.</p>
169    pub fn selected_choices(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.selected_choices(input.into());
171        self
172    }
173    /// <p>List of selected choice IDs in a question answer.</p>
174    /// <p>The values entered replace the previously selected choices.</p>
175    pub fn set_selected_choices(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
176        self.inner = self.inner.set_selected_choices(input);
177        self
178    }
179    /// <p>List of selected choice IDs in a question answer.</p>
180    /// <p>The values entered replace the previously selected choices.</p>
181    pub fn get_selected_choices(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
182        self.inner.get_selected_choices()
183    }
184    ///
185    /// Adds a key-value pair to `ChoiceUpdates`.
186    ///
187    /// To override the contents of this collection use [`set_choice_updates`](Self::set_choice_updates).
188    ///
189    /// <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>
190    pub fn choice_updates(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ChoiceUpdate) -> Self {
191        self.inner = self.inner.choice_updates(k.into(), v);
192        self
193    }
194    /// <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>
195    pub fn set_choice_updates(
196        mut self,
197        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>>,
198    ) -> Self {
199        self.inner = self.inner.set_choice_updates(input);
200        self
201    }
202    /// <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>
203    pub fn get_choice_updates(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ChoiceUpdate>> {
204        self.inner.get_choice_updates()
205    }
206    /// <p>The notes associated with the workload.</p>
207    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
208    pub fn notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.notes(input.into());
210        self
211    }
212    /// <p>The notes associated with the workload.</p>
213    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
214    pub fn set_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_notes(input);
216        self
217    }
218    /// <p>The notes associated with the workload.</p>
219    /// <p>For a review template, these are the notes that will be associated with the workload when the template is applied.</p>
220    pub fn get_notes(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_notes()
222    }
223    /// <p>Defines whether this question is applicable to a lens review.</p>
224    pub fn is_applicable(mut self, input: bool) -> Self {
225        self.inner = self.inner.is_applicable(input);
226        self
227    }
228    /// <p>Defines whether this question is applicable to a lens review.</p>
229    pub fn set_is_applicable(mut self, input: ::std::option::Option<bool>) -> Self {
230        self.inner = self.inner.set_is_applicable(input);
231        self
232    }
233    /// <p>Defines whether this question is applicable to a lens review.</p>
234    pub fn get_is_applicable(&self) -> &::std::option::Option<bool> {
235        self.inner.get_is_applicable()
236    }
237    /// <p>The reason why a question is not applicable to your workload.</p>
238    pub fn reason(mut self, input: crate::types::AnswerReason) -> Self {
239        self.inner = self.inner.reason(input);
240        self
241    }
242    /// <p>The reason why a question is not applicable to your workload.</p>
243    pub fn set_reason(mut self, input: ::std::option::Option<crate::types::AnswerReason>) -> Self {
244        self.inner = self.inner.set_reason(input);
245        self
246    }
247    /// <p>The reason why a question is not applicable to your workload.</p>
248    pub fn get_reason(&self) -> &::std::option::Option<crate::types::AnswerReason> {
249        self.inner.get_reason()
250    }
251}