aws_sdk_lexmodelbuilding/operation/delete_bot/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_bot::_delete_bot_output::DeleteBotOutputBuilder;
3
4pub use crate::operation::delete_bot::_delete_bot_input::DeleteBotInputBuilder;
5
6impl crate::operation::delete_bot::builders::DeleteBotInputBuilder {
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::delete_bot::DeleteBotOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_bot::DeleteBotError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_bot();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteBot`.
24///
25/// <p>Deletes all versions of the bot, including the <code>$LATEST</code> version. To delete a specific version of the bot, use the <code>DeleteBotVersion</code> operation. The <code>DeleteBot</code> operation doesn't immediately remove the bot schema. Instead, it is marked for deletion and removed later.</p>
26/// <p>Amazon Lex stores utterances indefinitely for improving the ability of your bot to respond to user inputs. These utterances are not removed when the bot is deleted. To remove the utterances, use the <code>DeleteUtterances</code> operation.</p>
27/// <p>If a bot has an alias, you can't delete it. Instead, the <code>DeleteBot</code> operation returns a <code>ResourceInUseException</code> exception that includes a reference to the alias that refers to the bot. To remove the reference to the bot, delete the alias. If you get the same exception again, delete the referring alias until the <code>DeleteBot</code> operation is successful.</p>
28/// <p>This operation requires permissions for the <code>lex:DeleteBot</code> action.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DeleteBotFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::delete_bot::builders::DeleteBotInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl crate::client::customize::internal::CustomizableSend<crate::operation::delete_bot::DeleteBotOutput, crate::operation::delete_bot::DeleteBotError>
36    for DeleteBotFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<crate::operation::delete_bot::DeleteBotOutput, crate::operation::delete_bot::DeleteBotError>,
43    > {
44        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45    }
46}
47impl DeleteBotFluentBuilder {
48    /// Creates a new `DeleteBotFluentBuilder`.
49    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50        Self {
51            handle,
52            inner: ::std::default::Default::default(),
53            config_override: ::std::option::Option::None,
54        }
55    }
56    /// Access the DeleteBot as a reference.
57    pub fn as_input(&self) -> &crate::operation::delete_bot::builders::DeleteBotInputBuilder {
58        &self.inner
59    }
60    /// Sends the request and returns the response.
61    ///
62    /// If an error occurs, an `SdkError` will be returned with additional details that
63    /// can be matched against.
64    ///
65    /// By default, any retryable failures will be retried twice. Retry behavior
66    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67    /// set when configuring the client.
68    pub async fn send(
69        self,
70    ) -> ::std::result::Result<
71        crate::operation::delete_bot::DeleteBotOutput,
72        ::aws_smithy_runtime_api::client::result::SdkError<
73            crate::operation::delete_bot::DeleteBotError,
74            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75        >,
76    > {
77        let input = self
78            .inner
79            .build()
80            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81        let runtime_plugins = crate::operation::delete_bot::DeleteBot::operation_runtime_plugins(
82            self.handle.runtime_plugins.clone(),
83            &self.handle.conf,
84            self.config_override,
85        );
86        crate::operation::delete_bot::DeleteBot::orchestrate(&runtime_plugins, input).await
87    }
88
89    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90    pub fn customize(
91        self,
92    ) -> crate::client::customize::CustomizableOperation<
93        crate::operation::delete_bot::DeleteBotOutput,
94        crate::operation::delete_bot::DeleteBotError,
95        Self,
96    > {
97        crate::client::customize::CustomizableOperation::new(self)
98    }
99    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100        self.set_config_override(::std::option::Option::Some(config_override.into()));
101        self
102    }
103
104    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105        self.config_override = config_override;
106        self
107    }
108    /// <p>The name of the bot. The name is case sensitive.</p>
109    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.name(input.into());
111        self
112    }
113    /// <p>The name of the bot. The name is case sensitive.</p>
114    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.inner = self.inner.set_name(input);
116        self
117    }
118    /// <p>The name of the bot. The name is case sensitive.</p>
119    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
120        self.inner.get_name()
121    }
122}