aws_sdk_lexmodelbuilding/operation/get_utterances_view/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_utterances_view::_get_utterances_view_output::GetUtterancesViewOutputBuilder;
3
4pub use crate::operation::get_utterances_view::_get_utterances_view_input::GetUtterancesViewInputBuilder;
5
6impl crate::operation::get_utterances_view::builders::GetUtterancesViewInputBuilder {
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::get_utterances_view::GetUtterancesViewOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_utterances_view::GetUtterancesViewError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_utterances_view();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetUtterancesView`.
24///
25/// <p>Use the <code>GetUtterancesView</code> operation to get information about the utterances that your users have made to your bot. You can use this list to tune the utterances that your bot responds to.</p>
26/// <p>For example, say that you have created a bot to order flowers. After your users have used your bot for a while, use the <code>GetUtterancesView</code> operation to see the requests that they have made and whether they have been successful. You might find that the utterance "I want flowers" is not being recognized. You could add this utterance to the <code>OrderFlowers</code> intent so that your bot recognizes that utterance.</p>
27/// <p>After you publish a new version of a bot, you can get information about the old version and the new so that you can compare the performance across the two versions.</p>
28/// <p>Utterance statistics are generated once a day. Data is available for the last 15 days. You can request information for up to 5 versions of your bot in each request. Amazon Lex returns the most frequent utterances received by the bot in the last 15 days. The response contains information about a maximum of 100 utterances for each version.</p>
29/// <p>If you set <code>childDirected</code> field to true when you created your bot, if you are using slot obfuscation with one or more slots, or if you opted out of participating in improving Amazon Lex, utterances are not available.</p>
30/// <p>This operation requires permissions for the <code>lex:GetUtterancesView</code> action.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct GetUtterancesViewFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::get_utterances_view::builders::GetUtterancesViewInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::get_utterances_view::GetUtterancesViewOutput,
40        crate::operation::get_utterances_view::GetUtterancesViewError,
41    > for GetUtterancesViewFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::get_utterances_view::GetUtterancesViewOutput,
49            crate::operation::get_utterances_view::GetUtterancesViewError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl GetUtterancesViewFluentBuilder {
56    /// Creates a new `GetUtterancesViewFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the GetUtterancesView as a reference.
65    pub fn as_input(&self) -> &crate::operation::get_utterances_view::builders::GetUtterancesViewInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::get_utterances_view::GetUtterancesViewOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::get_utterances_view::GetUtterancesViewError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::get_utterances_view::GetUtterancesView::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::get_utterances_view::GetUtterancesView::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::get_utterances_view::GetUtterancesViewOutput,
102        crate::operation::get_utterances_view::GetUtterancesViewError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The name of the bot for which utterance information should be returned.</p>
117    pub fn bot_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.bot_name(input.into());
119        self
120    }
121    /// <p>The name of the bot for which utterance information should be returned.</p>
122    pub fn set_bot_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_bot_name(input);
124        self
125    }
126    /// <p>The name of the bot for which utterance information should be returned.</p>
127    pub fn get_bot_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_bot_name()
129    }
130    ///
131    /// Appends an item to `botVersions`.
132    ///
133    /// To override the contents of this collection use [`set_bot_versions`](Self::set_bot_versions).
134    ///
135    /// <p>An array of bot versions for which utterance information should be returned. The limit is 5 versions per request.</p>
136    pub fn bot_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.bot_versions(input.into());
138        self
139    }
140    /// <p>An array of bot versions for which utterance information should be returned. The limit is 5 versions per request.</p>
141    pub fn set_bot_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
142        self.inner = self.inner.set_bot_versions(input);
143        self
144    }
145    /// <p>An array of bot versions for which utterance information should be returned. The limit is 5 versions per request.</p>
146    pub fn get_bot_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
147        self.inner.get_bot_versions()
148    }
149    /// <p>To return utterances that were recognized and handled, use <code>Detected</code>. To return utterances that were not recognized, use <code>Missed</code>.</p>
150    pub fn status_type(mut self, input: crate::types::StatusType) -> Self {
151        self.inner = self.inner.status_type(input);
152        self
153    }
154    /// <p>To return utterances that were recognized and handled, use <code>Detected</code>. To return utterances that were not recognized, use <code>Missed</code>.</p>
155    pub fn set_status_type(mut self, input: ::std::option::Option<crate::types::StatusType>) -> Self {
156        self.inner = self.inner.set_status_type(input);
157        self
158    }
159    /// <p>To return utterances that were recognized and handled, use <code>Detected</code>. To return utterances that were not recognized, use <code>Missed</code>.</p>
160    pub fn get_status_type(&self) -> &::std::option::Option<crate::types::StatusType> {
161        self.inner.get_status_type()
162    }
163}