aws_sdk_lexmodelsv2/operation/list_utterance_analytics_data/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_utterance_analytics_data::_list_utterance_analytics_data_output::ListUtteranceAnalyticsDataOutputBuilder;
3
4pub use crate::operation::list_utterance_analytics_data::_list_utterance_analytics_data_input::ListUtteranceAnalyticsDataInputBuilder;
5
6impl crate::operation::list_utterance_analytics_data::builders::ListUtteranceAnalyticsDataInputBuilder {
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_utterance_analytics_data::ListUtteranceAnalyticsDataOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_utterance_analytics_data();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListUtteranceAnalyticsData`.
24///
25/// <note>
26/// <p>To use this API operation, your IAM role must have permissions to perform the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_ListAggregatedUtterances.html">ListAggregatedUtterances</a> operation, which provides access to utterance-related analytics. See <a href="https://docs.aws.amazon.com/lexv2/latest/dg/monitoring-utterances.html">Viewing utterance statistics</a> for the IAM policy to apply to the IAM role.</p>
27/// </note>
28/// <p>Retrieves a list of metadata for individual user utterances to your bot. The following fields are required:</p>
29/// <ul>
30/// <li>
31/// <p><code>startDateTime</code> and <code>endDateTime</code> – Define a time range for which you want to retrieve results.</p></li>
32/// </ul>
33/// <p>Of the optional fields, you can organize the results in the following ways:</p>
34/// <ul>
35/// <li>
36/// <p>Use the <code>filters</code> field to filter the results and the <code>sortBy</code> field to specify the values by which to sort the results.</p></li>
37/// <li>
38/// <p>Use the <code>maxResults</code> field to limit the number of results to return in a single response and the <code>nextToken</code> field to return the next batch of results if the response does not return the full set of results.</p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct ListUtteranceAnalyticsDataFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::list_utterance_analytics_data::builders::ListUtteranceAnalyticsDataInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataOutput,
49        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataError,
50    > for ListUtteranceAnalyticsDataFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataOutput,
58            crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl ListUtteranceAnalyticsDataFluentBuilder {
65    /// Creates a new `ListUtteranceAnalyticsDataFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the ListUtteranceAnalyticsData as a reference.
74    pub fn as_input(&self) -> &crate::operation::list_utterance_analytics_data::builders::ListUtteranceAnalyticsDataInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsData::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsData::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataOutput,
111        crate::operation::list_utterance_analytics_data::ListUtteranceAnalyticsDataError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// Create a paginator for this request
126    ///
127    /// Paginators are used by calling [`send().await`](crate::operation::list_utterance_analytics_data::paginator::ListUtteranceAnalyticsDataPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
128    pub fn into_paginator(self) -> crate::operation::list_utterance_analytics_data::paginator::ListUtteranceAnalyticsDataPaginator {
129        crate::operation::list_utterance_analytics_data::paginator::ListUtteranceAnalyticsDataPaginator::new(self.handle, self.inner)
130    }
131    /// <p>The identifier for the bot for which you want to retrieve utterance analytics.</p>
132    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.bot_id(input.into());
134        self
135    }
136    /// <p>The identifier for the bot for which you want to retrieve utterance analytics.</p>
137    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_bot_id(input);
139        self
140    }
141    /// <p>The identifier for the bot for which you want to retrieve utterance analytics.</p>
142    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_bot_id()
144    }
145    /// <p>The date and time that marks the beginning of the range of time for which you want to see utterance analytics.</p>
146    pub fn start_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
147        self.inner = self.inner.start_date_time(input);
148        self
149    }
150    /// <p>The date and time that marks the beginning of the range of time for which you want to see utterance analytics.</p>
151    pub fn set_start_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
152        self.inner = self.inner.set_start_date_time(input);
153        self
154    }
155    /// <p>The date and time that marks the beginning of the range of time for which you want to see utterance analytics.</p>
156    pub fn get_start_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
157        self.inner.get_start_date_time()
158    }
159    /// <p>The date and time that marks the end of the range of time for which you want to see utterance analytics.</p>
160    pub fn end_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
161        self.inner = self.inner.end_date_time(input);
162        self
163    }
164    /// <p>The date and time that marks the end of the range of time for which you want to see utterance analytics.</p>
165    pub fn set_end_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
166        self.inner = self.inner.set_end_date_time(input);
167        self
168    }
169    /// <p>The date and time that marks the end of the range of time for which you want to see utterance analytics.</p>
170    pub fn get_end_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
171        self.inner.get_end_date_time()
172    }
173    /// <p>An object specifying the measure and method by which to sort the utterance analytics data.</p>
174    pub fn sort_by(mut self, input: crate::types::UtteranceDataSortBy) -> Self {
175        self.inner = self.inner.sort_by(input);
176        self
177    }
178    /// <p>An object specifying the measure and method by which to sort the utterance analytics data.</p>
179    pub fn set_sort_by(mut self, input: ::std::option::Option<crate::types::UtteranceDataSortBy>) -> Self {
180        self.inner = self.inner.set_sort_by(input);
181        self
182    }
183    /// <p>An object specifying the measure and method by which to sort the utterance analytics data.</p>
184    pub fn get_sort_by(&self) -> &::std::option::Option<crate::types::UtteranceDataSortBy> {
185        self.inner.get_sort_by()
186    }
187    ///
188    /// Appends an item to `filters`.
189    ///
190    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
191    ///
192    /// <p>A list of objects, each of which describes a condition by which you want to filter the results.</p>
193    pub fn filters(mut self, input: crate::types::AnalyticsUtteranceFilter) -> Self {
194        self.inner = self.inner.filters(input);
195        self
196    }
197    /// <p>A list of objects, each of which describes a condition by which you want to filter the results.</p>
198    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AnalyticsUtteranceFilter>>) -> Self {
199        self.inner = self.inner.set_filters(input);
200        self
201    }
202    /// <p>A list of objects, each of which describes a condition by which you want to filter the results.</p>
203    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AnalyticsUtteranceFilter>> {
204        self.inner.get_filters()
205    }
206    /// <p>The maximum number of results 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.</p>
207    pub fn max_results(mut self, input: i32) -> Self {
208        self.inner = self.inner.max_results(input);
209        self
210    }
211    /// <p>The maximum number of results 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.</p>
212    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
213        self.inner = self.inner.set_max_results(input);
214        self
215    }
216    /// <p>The maximum number of results 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.</p>
217    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
218        self.inner.get_max_results()
219    }
220    /// <p>If the response from the ListUtteranceAnalyticsData operation contains more results than specified in the maxResults parameter, a token is returned in the response.</p>
221    /// <p>Use the returned token in the nextToken parameter of a ListUtteranceAnalyticsData request to return the next page of results. For a complete set of results, call the ListUtteranceAnalyticsData operation until the nextToken returned in the response is null.</p>
222    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        self.inner = self.inner.next_token(input.into());
224        self
225    }
226    /// <p>If the response from the ListUtteranceAnalyticsData operation contains more results than specified in the maxResults parameter, a token is returned in the response.</p>
227    /// <p>Use the returned token in the nextToken parameter of a ListUtteranceAnalyticsData request to return the next page of results. For a complete set of results, call the ListUtteranceAnalyticsData operation until the nextToken returned in the response is null.</p>
228    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_next_token(input);
230        self
231    }
232    /// <p>If the response from the ListUtteranceAnalyticsData operation contains more results than specified in the maxResults parameter, a token is returned in the response.</p>
233    /// <p>Use the returned token in the nextToken parameter of a ListUtteranceAnalyticsData request to return the next page of results. For a complete set of results, call the ListUtteranceAnalyticsData operation until the nextToken returned in the response is null.</p>
234    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
235        self.inner.get_next_token()
236    }
237}