aws_sdk_lexmodelsv2/operation/list_intent_paths/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_intent_paths::_list_intent_paths_output::ListIntentPathsOutputBuilder;
3
4pub use crate::operation::list_intent_paths::_list_intent_paths_input::ListIntentPathsInputBuilder;
5
6impl crate::operation::list_intent_paths::builders::ListIntentPathsInputBuilder {
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_intent_paths::ListIntentPathsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_intent_paths::ListIntentPathsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_intent_paths();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListIntentPaths`.
24///
25/// <p>Retrieves summary statistics for a path of intents that users take over sessions with your bot. The following fields are required:</p>
26/// <ul>
27/// <li>
28/// <p><code>startDateTime</code> and <code>endDateTime</code> – Define a time range for which you want to retrieve results.</p></li>
29/// <li>
30/// <p><code>intentPath</code> – Define an order of intents for which you want to retrieve metrics. Separate intents in the path with a forward slash. For example, populate the <code>intentPath</code> field with <code>/BookCar/BookHotel</code> to see details about how many times users invoked the <code>BookCar</code> and <code>BookHotel</code> intents in that order.</p></li>
31/// </ul>
32/// <p>Use the optional <code>filters</code> field to filter the results.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct ListIntentPathsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::list_intent_paths::builders::ListIntentPathsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::list_intent_paths::ListIntentPathsOutput,
42        crate::operation::list_intent_paths::ListIntentPathsError,
43    > for ListIntentPathsFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::list_intent_paths::ListIntentPathsOutput,
51            crate::operation::list_intent_paths::ListIntentPathsError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl ListIntentPathsFluentBuilder {
58    /// Creates a new `ListIntentPathsFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the ListIntentPaths as a reference.
67    pub fn as_input(&self) -> &crate::operation::list_intent_paths::builders::ListIntentPathsInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::list_intent_paths::ListIntentPathsOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::list_intent_paths::ListIntentPathsError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::list_intent_paths::ListIntentPaths::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::list_intent_paths::ListIntentPaths::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::list_intent_paths::ListIntentPathsOutput,
104        crate::operation::list_intent_paths::ListIntentPathsError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The identifier for the bot for which you want to retrieve intent path metrics.</p>
119    pub fn bot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.bot_id(input.into());
121        self
122    }
123    /// <p>The identifier for the bot for which you want to retrieve intent path metrics.</p>
124    pub fn set_bot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_bot_id(input);
126        self
127    }
128    /// <p>The identifier for the bot for which you want to retrieve intent path metrics.</p>
129    pub fn get_bot_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_bot_id()
131    }
132    /// <p>The date and time that marks the beginning of the range of time for which you want to see intent path metrics.</p>
133    pub fn start_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
134        self.inner = self.inner.start_date_time(input);
135        self
136    }
137    /// <p>The date and time that marks the beginning of the range of time for which you want to see intent path metrics.</p>
138    pub fn set_start_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
139        self.inner = self.inner.set_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 intent path metrics.</p>
143    pub fn get_start_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
144        self.inner.get_start_date_time()
145    }
146    /// <p>The date and time that marks the end of the range of time for which you want to see intent path metrics.</p>
147    pub fn end_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
148        self.inner = self.inner.end_date_time(input);
149        self
150    }
151    /// <p>The date and time that marks the end of the range of time for which you want to see intent path metrics.</p>
152    pub fn set_end_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
153        self.inner = self.inner.set_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 intent path metrics.</p>
157    pub fn get_end_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
158        self.inner.get_end_date_time()
159    }
160    /// <p>The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:</p>
161    /// <ul>
162    /// <li>
163    /// <p>/BookCar</p></li>
164    /// <li>
165    /// <p>/BookCar/BookHotel</p></li>
166    /// <li>
167    /// <p>/BookHotel/BookCar</p></li>
168    /// </ul>
169    pub fn intent_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.intent_path(input.into());
171        self
172    }
173    /// <p>The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:</p>
174    /// <ul>
175    /// <li>
176    /// <p>/BookCar</p></li>
177    /// <li>
178    /// <p>/BookCar/BookHotel</p></li>
179    /// <li>
180    /// <p>/BookHotel/BookCar</p></li>
181    /// </ul>
182    pub fn set_intent_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_intent_path(input);
184        self
185    }
186    /// <p>The intent path for which you want to retrieve metrics. Use a forward slash to separate intents in the path. For example:</p>
187    /// <ul>
188    /// <li>
189    /// <p>/BookCar</p></li>
190    /// <li>
191    /// <p>/BookCar/BookHotel</p></li>
192    /// <li>
193    /// <p>/BookHotel/BookCar</p></li>
194    /// </ul>
195    pub fn get_intent_path(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_intent_path()
197    }
198    ///
199    /// Appends an item to `filters`.
200    ///
201    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
202    ///
203    /// <p>A list of objects, each describes a condition by which you want to filter the results.</p>
204    pub fn filters(mut self, input: crate::types::AnalyticsPathFilter) -> Self {
205        self.inner = self.inner.filters(input);
206        self
207    }
208    /// <p>A list of objects, each describes a condition by which you want to filter the results.</p>
209    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AnalyticsPathFilter>>) -> Self {
210        self.inner = self.inner.set_filters(input);
211        self
212    }
213    /// <p>A list of objects, each describes a condition by which you want to filter the results.</p>
214    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AnalyticsPathFilter>> {
215        self.inner.get_filters()
216    }
217}