aws_sdk_lexmodelsv2/operation/update_intent/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_intent::_update_intent_output::UpdateIntentOutputBuilder;
3
4pub use crate::operation::update_intent::_update_intent_input::UpdateIntentInputBuilder;
5
6impl crate::operation::update_intent::builders::UpdateIntentInputBuilder {
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_intent::UpdateIntentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_intent::UpdateIntentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_intent();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateIntent`.
24///
25/// <p>Updates the settings for an intent.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateIntentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_intent::builders::UpdateIntentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_intent::UpdateIntentOutput,
35        crate::operation::update_intent::UpdateIntentError,
36    > for UpdateIntentFluentBuilder
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_intent::UpdateIntentOutput,
44            crate::operation::update_intent::UpdateIntentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateIntentFluentBuilder {
51    /// Creates a new `UpdateIntentFluentBuilder`.
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 UpdateIntent as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_intent::builders::UpdateIntentInputBuilder {
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_intent::UpdateIntentOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_intent::UpdateIntentError,
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_intent::UpdateIntent::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_intent::UpdateIntent::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_intent::UpdateIntentOutput,
97        crate::operation::update_intent::UpdateIntentError,
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 unique identifier of the intent to update.</p>
112    pub fn intent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.intent_id(input.into());
114        self
115    }
116    /// <p>The unique identifier of the intent to update.</p>
117    pub fn set_intent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_intent_id(input);
119        self
120    }
121    /// <p>The unique identifier of the intent to update.</p>
122    pub fn get_intent_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_intent_id()
124    }
125    /// <p>The new name for the intent.</p>
126    pub fn intent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.intent_name(input.into());
128        self
129    }
130    /// <p>The new name for the intent.</p>
131    pub fn set_intent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_intent_name(input);
133        self
134    }
135    /// <p>The new name for the intent.</p>
136    pub fn get_intent_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_intent_name()
138    }
139    /// <p>The new description of the intent.</p>
140    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.description(input.into());
142        self
143    }
144    /// <p>The new description of the intent.</p>
145    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_description(input);
147        self
148    }
149    /// <p>The new description of the intent.</p>
150    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_description()
152    }
153    /// <p>The signature of the new built-in intent to use as the parent of this intent.</p>
154    pub fn parent_intent_signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.parent_intent_signature(input.into());
156        self
157    }
158    /// <p>The signature of the new built-in intent to use as the parent of this intent.</p>
159    pub fn set_parent_intent_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_parent_intent_signature(input);
161        self
162    }
163    /// <p>The signature of the new built-in intent to use as the parent of this intent.</p>
164    pub fn get_parent_intent_signature(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_parent_intent_signature()
166    }
167    ///
168    /// Appends an item to `sampleUtterances`.
169    ///
170    /// To override the contents of this collection use [`set_sample_utterances`](Self::set_sample_utterances).
171    ///
172    /// <p>New utterances used to invoke the intent.</p>
173    pub fn sample_utterances(mut self, input: crate::types::SampleUtterance) -> Self {
174        self.inner = self.inner.sample_utterances(input);
175        self
176    }
177    /// <p>New utterances used to invoke the intent.</p>
178    pub fn set_sample_utterances(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>>) -> Self {
179        self.inner = self.inner.set_sample_utterances(input);
180        self
181    }
182    /// <p>New utterances used to invoke the intent.</p>
183    pub fn get_sample_utterances(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SampleUtterance>> {
184        self.inner.get_sample_utterances()
185    }
186    /// <p>The new Lambda function to use between each turn of the conversation with the bot.</p>
187    pub fn dialog_code_hook(mut self, input: crate::types::DialogCodeHookSettings) -> Self {
188        self.inner = self.inner.dialog_code_hook(input);
189        self
190    }
191    /// <p>The new Lambda function to use between each turn of the conversation with the bot.</p>
192    pub fn set_dialog_code_hook(mut self, input: ::std::option::Option<crate::types::DialogCodeHookSettings>) -> Self {
193        self.inner = self.inner.set_dialog_code_hook(input);
194        self
195    }
196    /// <p>The new Lambda function to use between each turn of the conversation with the bot.</p>
197    pub fn get_dialog_code_hook(&self) -> &::std::option::Option<crate::types::DialogCodeHookSettings> {
198        self.inner.get_dialog_code_hook()
199    }
200    /// <p>The new Lambda function to call when all of the intents required slots are provided and the intent is ready for fulfillment.</p>
201    pub fn fulfillment_code_hook(mut self, input: crate::types::FulfillmentCodeHookSettings) -> Self {
202        self.inner = self.inner.fulfillment_code_hook(input);
203        self
204    }
205    /// <p>The new Lambda function to call when all of the intents required slots are provided and the intent is ready for fulfillment.</p>
206    pub fn set_fulfillment_code_hook(mut self, input: ::std::option::Option<crate::types::FulfillmentCodeHookSettings>) -> Self {
207        self.inner = self.inner.set_fulfillment_code_hook(input);
208        self
209    }
210    /// <p>The new Lambda function to call when all of the intents required slots are provided and the intent is ready for fulfillment.</p>
211    pub fn get_fulfillment_code_hook(&self) -> &::std::option::Option<crate::types::FulfillmentCodeHookSettings> {
212        self.inner.get_fulfillment_code_hook()
213    }
214    ///
215    /// Appends an item to `slotPriorities`.
216    ///
217    /// To override the contents of this collection use [`set_slot_priorities`](Self::set_slot_priorities).
218    ///
219    /// <p>A new list of slots and their priorities that are contained by the intent.</p>
220    pub fn slot_priorities(mut self, input: crate::types::SlotPriority) -> Self {
221        self.inner = self.inner.slot_priorities(input);
222        self
223    }
224    /// <p>A new list of slots and their priorities that are contained by the intent.</p>
225    pub fn set_slot_priorities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SlotPriority>>) -> Self {
226        self.inner = self.inner.set_slot_priorities(input);
227        self
228    }
229    /// <p>A new list of slots and their priorities that are contained by the intent.</p>
230    pub fn get_slot_priorities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SlotPriority>> {
231        self.inner.get_slot_priorities()
232    }
233    /// <p>New prompts that Amazon Lex sends to the user to confirm the completion of an intent.</p>
234    pub fn intent_confirmation_setting(mut self, input: crate::types::IntentConfirmationSetting) -> Self {
235        self.inner = self.inner.intent_confirmation_setting(input);
236        self
237    }
238    /// <p>New prompts that Amazon Lex sends to the user to confirm the completion of an intent.</p>
239    pub fn set_intent_confirmation_setting(mut self, input: ::std::option::Option<crate::types::IntentConfirmationSetting>) -> Self {
240        self.inner = self.inner.set_intent_confirmation_setting(input);
241        self
242    }
243    /// <p>New prompts that Amazon Lex sends to the user to confirm the completion of an intent.</p>
244    pub fn get_intent_confirmation_setting(&self) -> &::std::option::Option<crate::types::IntentConfirmationSetting> {
245        self.inner.get_intent_confirmation_setting()
246    }
247    /// <p>The new response that Amazon Lex sends the user when the intent is closed.</p>
248    pub fn intent_closing_setting(mut self, input: crate::types::IntentClosingSetting) -> Self {
249        self.inner = self.inner.intent_closing_setting(input);
250        self
251    }
252    /// <p>The new response that Amazon Lex sends the user when the intent is closed.</p>
253    pub fn set_intent_closing_setting(mut self, input: ::std::option::Option<crate::types::IntentClosingSetting>) -> Self {
254        self.inner = self.inner.set_intent_closing_setting(input);
255        self
256    }
257    /// <p>The new response that Amazon Lex sends the user when the intent is closed.</p>
258    pub fn get_intent_closing_setting(&self) -> &::std::option::Option<crate::types::IntentClosingSetting> {
259        self.inner.get_intent_closing_setting()
260    }
261    ///
262    /// Appends an item to `inputContexts`.
263    ///
264    /// To override the contents of this collection use [`set_input_contexts`](Self::set_input_contexts).
265    ///
266    /// <p>A new list of contexts that must be active in order for Amazon Lex to consider the intent.</p>
267    pub fn input_contexts(mut self, input: crate::types::InputContext) -> Self {
268        self.inner = self.inner.input_contexts(input);
269        self
270    }
271    /// <p>A new list of contexts that must be active in order for Amazon Lex to consider the intent.</p>
272    pub fn set_input_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InputContext>>) -> Self {
273        self.inner = self.inner.set_input_contexts(input);
274        self
275    }
276    /// <p>A new list of contexts that must be active in order for Amazon Lex to consider the intent.</p>
277    pub fn get_input_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InputContext>> {
278        self.inner.get_input_contexts()
279    }
280    ///
281    /// Appends an item to `outputContexts`.
282    ///
283    /// To override the contents of this collection use [`set_output_contexts`](Self::set_output_contexts).
284    ///
285    /// <p>A new list of contexts that Amazon Lex activates when the intent is fulfilled.</p>
286    pub fn output_contexts(mut self, input: crate::types::OutputContext) -> Self {
287        self.inner = self.inner.output_contexts(input);
288        self
289    }
290    /// <p>A new list of contexts that Amazon Lex activates when the intent is fulfilled.</p>
291    pub fn set_output_contexts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OutputContext>>) -> Self {
292        self.inner = self.inner.set_output_contexts(input);
293        self
294    }
295    /// <p>A new list of contexts that Amazon Lex activates when the intent is fulfilled.</p>
296    pub fn get_output_contexts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OutputContext>> {
297        self.inner.get_output_contexts()
298    }
299    /// <p>New configuration settings for connecting to an Amazon Kendra index.</p>
300    pub fn kendra_configuration(mut self, input: crate::types::KendraConfiguration) -> Self {
301        self.inner = self.inner.kendra_configuration(input);
302        self
303    }
304    /// <p>New configuration settings for connecting to an Amazon Kendra index.</p>
305    pub fn set_kendra_configuration(mut self, input: ::std::option::Option<crate::types::KendraConfiguration>) -> Self {
306        self.inner = self.inner.set_kendra_configuration(input);
307        self
308    }
309    /// <p>New configuration settings for connecting to an Amazon Kendra index.</p>
310    pub fn get_kendra_configuration(&self) -> &::std::option::Option<crate::types::KendraConfiguration> {
311        self.inner.get_kendra_configuration()
312    }
313    /// <p>The identifier of the bot that contains the intent.</p>
314    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
315        self.inner = self.inner.bot_id(input.into());
316        self
317    }
318    /// <p>The identifier of the bot that contains the intent.</p>
319    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
320        self.inner = self.inner.set_bot_id(input);
321        self
322    }
323    /// <p>The identifier of the bot that contains the intent.</p>
324    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
325        self.inner.get_bot_id()
326    }
327    /// <p>The version of the bot that contains the intent. Must be <code>DRAFT</code>.</p>
328    pub fn bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
329        self.inner = self.inner.bot_version(input.into());
330        self
331    }
332    /// <p>The version of the bot that contains the intent. Must be <code>DRAFT</code>.</p>
333    pub fn set_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
334        self.inner = self.inner.set_bot_version(input);
335        self
336    }
337    /// <p>The version of the bot that contains the intent. Must be <code>DRAFT</code>.</p>
338    pub fn get_bot_version(&self) -> &::std::option::Option<::std::string::String> {
339        self.inner.get_bot_version()
340    }
341    /// <p>The identifier of the language and locale where this intent is used. The string must match one of the supported locales. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
342    pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
343        self.inner = self.inner.locale_id(input.into());
344        self
345    }
346    /// <p>The identifier of the language and locale where this intent is used. The string must match one of the supported locales. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
347    pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
348        self.inner = self.inner.set_locale_id(input);
349        self
350    }
351    /// <p>The identifier of the language and locale where this intent is used. The string must match one of the supported locales. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
352    pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
353        self.inner.get_locale_id()
354    }
355    /// <p>Configuration settings for a response sent to the user before Amazon Lex starts eliciting slots.</p>
356    pub fn initial_response_setting(mut self, input: crate::types::InitialResponseSetting) -> Self {
357        self.inner = self.inner.initial_response_setting(input);
358        self
359    }
360    /// <p>Configuration settings for a response sent to the user before Amazon Lex starts eliciting slots.</p>
361    pub fn set_initial_response_setting(mut self, input: ::std::option::Option<crate::types::InitialResponseSetting>) -> Self {
362        self.inner = self.inner.set_initial_response_setting(input);
363        self
364    }
365    /// <p>Configuration settings for a response sent to the user before Amazon Lex starts eliciting slots.</p>
366    pub fn get_initial_response_setting(&self) -> &::std::option::Option<crate::types::InitialResponseSetting> {
367        self.inner.get_initial_response_setting()
368    }
369    /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
370    pub fn qn_a_intent_configuration(mut self, input: crate::types::QnAIntentConfiguration) -> Self {
371        self.inner = self.inner.qn_a_intent_configuration(input);
372        self
373    }
374    /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
375    pub fn set_qn_a_intent_configuration(mut self, input: ::std::option::Option<crate::types::QnAIntentConfiguration>) -> Self {
376        self.inner = self.inner.set_qn_a_intent_configuration(input);
377        self
378    }
379    /// <p>Specifies the configuration of the built-in <code>Amazon.QnAIntent</code>. The <code>AMAZON.QnAIntent</code> intent is called when Amazon Lex can't determine another intent to invoke. If you specify this field, you can't specify the <code>kendraConfiguration</code> field.</p>
380    pub fn get_qn_a_intent_configuration(&self) -> &::std::option::Option<crate::types::QnAIntentConfiguration> {
381        self.inner.get_qn_a_intent_configuration()
382    }
383    /// <p>Qinconnect intent configuration details for the update intent request.</p>
384    pub fn q_in_connect_intent_configuration(mut self, input: crate::types::QInConnectIntentConfiguration) -> Self {
385        self.inner = self.inner.q_in_connect_intent_configuration(input);
386        self
387    }
388    /// <p>Qinconnect intent configuration details for the update intent request.</p>
389    pub fn set_q_in_connect_intent_configuration(mut self, input: ::std::option::Option<crate::types::QInConnectIntentConfiguration>) -> Self {
390        self.inner = self.inner.set_q_in_connect_intent_configuration(input);
391        self
392    }
393    /// <p>Qinconnect intent configuration details for the update intent request.</p>
394    pub fn get_q_in_connect_intent_configuration(&self) -> &::std::option::Option<crate::types::QInConnectIntentConfiguration> {
395        self.inner.get_q_in_connect_intent_configuration()
396    }
397}