aws_sdk_lexmodelsv2/operation/list_aggregated_utterances/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_aggregated_utterances::_list_aggregated_utterances_output::ListAggregatedUtterancesOutputBuilder;
3
4pub use crate::operation::list_aggregated_utterances::_list_aggregated_utterances_input::ListAggregatedUtterancesInputBuilder;
5
6impl crate::operation::list_aggregated_utterances::builders::ListAggregatedUtterancesInputBuilder {
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::list_aggregated_utterances::ListAggregatedUtterancesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.list_aggregated_utterances();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `ListAggregatedUtterances`.
24///
25/// <p>Provides a list of utterances that users have sent to the bot.</p>
26/// <p>Utterances are aggregated by the text of the utterance. For example, all instances where customers used the phrase "I want to order pizza" are aggregated into the same line in the response.</p>
27/// <p>You can see both detected utterances and missed utterances. A detected utterance is where the bot properly recognized the utterance and activated the associated intent. A missed utterance was not recognized by the bot and didn't activate an intent.</p>
28/// <p>Utterances can be aggregated for a bot alias or for a bot version, but not both at the same time.</p>
29/// <p>Utterances statistics are not generated under the following conditions:</p>
30/// <ul>
31/// <li>
32/// <p>The <code>childDirected</code> field was set to true when the bot was created.</p></li>
33/// <li>
34/// <p>You are using slot obfuscation with one or more slots.</p></li>
35/// <li>
36/// <p>You opted out of participating in improving Amazon Lex.</p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct ListAggregatedUtterancesFluentBuilder {
40 handle: ::std::sync::Arc<crate::client::Handle>,
41 inner: crate::operation::list_aggregated_utterances::builders::ListAggregatedUtterancesInputBuilder,
42 config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45 crate::client::customize::internal::CustomizableSend<
46 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesOutput,
47 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesError,
48 > for ListAggregatedUtterancesFluentBuilder
49{
50 fn send(
51 self,
52 config_override: crate::config::Builder,
53 ) -> crate::client::customize::internal::BoxFuture<
54 crate::client::customize::internal::SendResult<
55 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesOutput,
56 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesError,
57 >,
58 > {
59 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60 }
61}
62impl ListAggregatedUtterancesFluentBuilder {
63 /// Creates a new `ListAggregatedUtterancesFluentBuilder`.
64 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65 Self {
66 handle,
67 inner: ::std::default::Default::default(),
68 config_override: ::std::option::Option::None,
69 }
70 }
71 /// Access the ListAggregatedUtterances as a reference.
72 pub fn as_input(&self) -> &crate::operation::list_aggregated_utterances::builders::ListAggregatedUtterancesInputBuilder {
73 &self.inner
74 }
75 /// Sends the request and returns the response.
76 ///
77 /// If an error occurs, an `SdkError` will be returned with additional details that
78 /// can be matched against.
79 ///
80 /// By default, any retryable failures will be retried twice. Retry behavior
81 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82 /// set when configuring the client.
83 pub async fn send(
84 self,
85 ) -> ::std::result::Result<
86 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesOutput,
87 ::aws_smithy_runtime_api::client::result::SdkError<
88 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesError,
89 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90 >,
91 > {
92 let input = self
93 .inner
94 .build()
95 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96 let runtime_plugins = crate::operation::list_aggregated_utterances::ListAggregatedUtterances::operation_runtime_plugins(
97 self.handle.runtime_plugins.clone(),
98 &self.handle.conf,
99 self.config_override,
100 );
101 crate::operation::list_aggregated_utterances::ListAggregatedUtterances::orchestrate(&runtime_plugins, input).await
102 }
103
104 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105 pub fn customize(
106 self,
107 ) -> crate::client::customize::CustomizableOperation<
108 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesOutput,
109 crate::operation::list_aggregated_utterances::ListAggregatedUtterancesError,
110 Self,
111 > {
112 crate::client::customize::CustomizableOperation::new(self)
113 }
114 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115 self.set_config_override(::std::option::Option::Some(config_override.into()));
116 self
117 }
118
119 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120 self.config_override = config_override;
121 self
122 }
123 /// Create a paginator for this request
124 ///
125 /// Paginators are used by calling [`send().await`](crate::operation::list_aggregated_utterances::paginator::ListAggregatedUtterancesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
126 pub fn into_paginator(self) -> crate::operation::list_aggregated_utterances::paginator::ListAggregatedUtterancesPaginator {
127 crate::operation::list_aggregated_utterances::paginator::ListAggregatedUtterancesPaginator::new(self.handle, self.inner)
128 }
129 /// <p>The unique identifier of the bot associated with this request.</p>
130 pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.bot_id(input.into());
132 self
133 }
134 /// <p>The unique identifier of the bot associated with this request.</p>
135 pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_bot_id(input);
137 self
138 }
139 /// <p>The unique identifier of the bot associated with this request.</p>
140 pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_bot_id()
142 }
143 /// <p>The identifier of the bot alias associated with this request. If you specify the bot alias, you can't specify the bot version.</p>
144 pub fn bot_alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145 self.inner = self.inner.bot_alias_id(input.into());
146 self
147 }
148 /// <p>The identifier of the bot alias associated with this request. If you specify the bot alias, you can't specify the bot version.</p>
149 pub fn set_bot_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150 self.inner = self.inner.set_bot_alias_id(input);
151 self
152 }
153 /// <p>The identifier of the bot alias associated with this request. If you specify the bot alias, you can't specify the bot version.</p>
154 pub fn get_bot_alias_id(&self) -> &::std::option::Option<::std::string::String> {
155 self.inner.get_bot_alias_id()
156 }
157 /// <p>The identifier of the bot version associated with this request. If you specify the bot version, you can't specify the bot alias.</p>
158 pub fn bot_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159 self.inner = self.inner.bot_version(input.into());
160 self
161 }
162 /// <p>The identifier of the bot version associated with this request. If you specify the bot version, you can't specify the bot alias.</p>
163 pub fn set_bot_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164 self.inner = self.inner.set_bot_version(input);
165 self
166 }
167 /// <p>The identifier of the bot version associated with this request. If you specify the bot version, you can't specify the bot alias.</p>
168 pub fn get_bot_version(&self) -> &::std::option::Option<::std::string::String> {
169 self.inner.get_bot_version()
170 }
171 /// <p>The identifier of the language and locale where the utterances were collected. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
172 pub fn locale_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173 self.inner = self.inner.locale_id(input.into());
174 self
175 }
176 /// <p>The identifier of the language and locale where the utterances were collected. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
177 pub fn set_locale_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178 self.inner = self.inner.set_locale_id(input);
179 self
180 }
181 /// <p>The identifier of the language and locale where the utterances were collected. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
182 pub fn get_locale_id(&self) -> &::std::option::Option<::std::string::String> {
183 self.inner.get_locale_id()
184 }
185 /// <p>The time window for aggregating the utterance information. You can specify a time between one hour and two weeks.</p>
186 pub fn aggregation_duration(mut self, input: crate::types::UtteranceAggregationDuration) -> Self {
187 self.inner = self.inner.aggregation_duration(input);
188 self
189 }
190 /// <p>The time window for aggregating the utterance information. You can specify a time between one hour and two weeks.</p>
191 pub fn set_aggregation_duration(mut self, input: ::std::option::Option<crate::types::UtteranceAggregationDuration>) -> Self {
192 self.inner = self.inner.set_aggregation_duration(input);
193 self
194 }
195 /// <p>The time window for aggregating the utterance information. You can specify a time between one hour and two weeks.</p>
196 pub fn get_aggregation_duration(&self) -> &::std::option::Option<crate::types::UtteranceAggregationDuration> {
197 self.inner.get_aggregation_duration()
198 }
199 /// <p>Specifies sorting parameters for the list of utterances. You can sort by the hit count, the missed count, or the number of distinct sessions the utterance appeared in.</p>
200 pub fn sort_by(mut self, input: crate::types::AggregatedUtterancesSortBy) -> Self {
201 self.inner = self.inner.sort_by(input);
202 self
203 }
204 /// <p>Specifies sorting parameters for the list of utterances. You can sort by the hit count, the missed count, or the number of distinct sessions the utterance appeared in.</p>
205 pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::AggregatedUtterancesSortBy>) -> Self {
206 self.inner = self.inner.set_sort_by(input);
207 self
208 }
209 /// <p>Specifies sorting parameters for the list of utterances. You can sort by the hit count, the missed count, or the number of distinct sessions the utterance appeared in.</p>
210 pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::AggregatedUtterancesSortBy> {
211 self.inner.get_sort_by()
212 }
213 ///
214 /// Appends an item to `filters`.
215 ///
216 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
217 ///
218 /// <p>Provides the specification of a filter used to limit the utterances in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.</p>
219 pub fn filters(mut self, input: crate::types::AggregatedUtterancesFilter) -> Self {
220 self.inner = self.inner.filters(input);
221 self
222 }
223 /// <p>Provides the specification of a filter used to limit the utterances in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.</p>
224 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AggregatedUtterancesFilter>>) -> Self {
225 self.inner = self.inner.set_filters(input);
226 self
227 }
228 /// <p>Provides the specification of a filter used to limit the utterances in the response to only those that match the filter specification. You can only specify one filter and one string to filter on.</p>
229 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AggregatedUtterancesFilter>> {
230 self.inner.get_filters()
231 }
232 /// <p>The maximum number of utterances to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned. If you don't specify the <code>maxResults</code> parameter, 1,000 results are returned.</p>
233 pub fn max_results(mut self, input: i32) -> Self {
234 self.inner = self.inner.max_results(input);
235 self
236 }
237 /// <p>The maximum number of utterances to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned. If you don't specify the <code>maxResults</code> parameter, 1,000 results are returned.</p>
238 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
239 self.inner = self.inner.set_max_results(input);
240 self
241 }
242 /// <p>The maximum number of utterances to return in each page of results. If there are fewer results than the maximum page size, only the actual number of results are returned. If you don't specify the <code>maxResults</code> parameter, 1,000 results are returned.</p>
243 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
244 self.inner.get_max_results()
245 }
246 /// <p>If the response from the <code>ListAggregatedUtterances</code> operation contains more results that specified in the <code>maxResults</code> parameter, a token is returned in the response. Use that token in the <code>nextToken</code> parameter to return the next page of results.</p>
247 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
248 self.inner = self.inner.next_token(input.into());
249 self
250 }
251 /// <p>If the response from the <code>ListAggregatedUtterances</code> operation contains more results that specified in the <code>maxResults</code> parameter, a token is returned in the response. Use that token in the <code>nextToken</code> parameter to return the next page of results.</p>
252 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
253 self.inner = self.inner.set_next_token(input);
254 self
255 }
256 /// <p>If the response from the <code>ListAggregatedUtterances</code> operation contains more results that specified in the <code>maxResults</code> parameter, a token is returned in the response. Use that token in the <code>nextToken</code> parameter to return the next page of results.</p>
257 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
258 self.inner.get_next_token()
259 }
260}