aws_sdk_lexmodelbuilding/operation/get_bots/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bots::_get_bots_output::GetBotsOutputBuilder;
3
4pub use crate::operation::get_bots::_get_bots_input::GetBotsInputBuilder;
5
6impl crate::operation::get_bots::builders::GetBotsInputBuilder {
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_bots::GetBotsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_bots::GetBotsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_bots();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetBots`.
24///
25/// <p>Returns bot information as follows:</p>
26/// <ul>
27/// <li>
28/// <p>If you provide the <code>nameContains</code> field, the response includes information for the <code>$LATEST</code> version of all bots whose name contains the specified string.</p></li>
29/// <li>
30/// <p>If you don't specify the <code>nameContains</code> field, the operation returns information about the <code>$LATEST</code> version of all of your bots.</p></li>
31/// </ul>
32/// <p>This operation requires permission for the <code>lex:GetBots</code> action.</p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct GetBotsFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::get_bots::builders::GetBotsInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl crate::client::customize::internal::CustomizableSend<crate::operation::get_bots::GetBotsOutput, crate::operation::get_bots::GetBotsError>
40    for GetBotsFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<crate::operation::get_bots::GetBotsOutput, crate::operation::get_bots::GetBotsError>,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl GetBotsFluentBuilder {
52    /// Creates a new `GetBotsFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the GetBots as a reference.
61    pub fn as_input(&self) -> &crate::operation::get_bots::builders::GetBotsInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::get_bots::GetBotsOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::get_bots::GetBotsError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::get_bots::GetBots::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::get_bots::GetBots::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_bots::GetBotsOutput, crate::operation::get_bots::GetBotsError, Self>
97    {
98        crate::client::customize::CustomizableOperation::new(self)
99    }
100    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
101        self.set_config_override(::std::option::Option::Some(config_override.into()));
102        self
103    }
104
105    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
106        self.config_override = config_override;
107        self
108    }
109    /// Create a paginator for this request
110    ///
111    /// Paginators are used by calling [`send().await`](crate::operation::get_bots::paginator::GetBotsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
112    pub fn into_paginator(self) -> crate::operation::get_bots::paginator::GetBotsPaginator {
113        crate::operation::get_bots::paginator::GetBotsPaginator::new(self.handle, self.inner)
114    }
115    /// <p>A pagination token that fetches the next page of bots. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of bots, specify the pagination token in the next request.</p>
116    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.next_token(input.into());
118        self
119    }
120    /// <p>A pagination token that fetches the next page of bots. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of bots, specify the pagination token in the next request.</p>
121    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_next_token(input);
123        self
124    }
125    /// <p>A pagination token that fetches the next page of bots. If the response to this call is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of bots, specify the pagination token in the next request.</p>
126    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_next_token()
128    }
129    /// <p>The maximum number of bots to return in the response that the request will return. The default is 10.</p>
130    pub fn max_results(mut self, input: i32) -> Self {
131        self.inner = self.inner.max_results(input);
132        self
133    }
134    /// <p>The maximum number of bots to return in the response that the request will return. The default is 10.</p>
135    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
136        self.inner = self.inner.set_max_results(input);
137        self
138    }
139    /// <p>The maximum number of bots to return in the response that the request will return. The default is 10.</p>
140    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
141        self.inner.get_max_results()
142    }
143    /// <p>Substring to match in bot names. A bot will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."</p>
144    pub fn name_contains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.name_contains(input.into());
146        self
147    }
148    /// <p>Substring to match in bot names. A bot will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."</p>
149    pub fn set_name_contains(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_name_contains(input);
151        self
152    }
153    /// <p>Substring to match in bot names. A bot will be returned if any part of its name matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."</p>
154    pub fn get_name_contains(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_name_contains()
156    }
157}