aws_sdk_lexmodelsv2/operation/list_session_analytics_data/
builders.rs

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