aws_sdk_sfn/operation/delete_state_machine/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_state_machine::_delete_state_machine_output::DeleteStateMachineOutputBuilder;
3
4pub use crate::operation::delete_state_machine::_delete_state_machine_input::DeleteStateMachineInputBuilder;
5
6impl crate::operation::delete_state_machine::builders::DeleteStateMachineInputBuilder {
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_state_machine::DeleteStateMachineOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_state_machine::DeleteStateMachineError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_state_machine();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteStateMachine`.
24///
25/// <p>Deletes a state machine. This is an asynchronous operation. It sets the state machine's status to <code>DELETING</code> and begins the deletion process. A state machine is deleted only when all its executions are completed. On the next state transition, the state machine's executions are terminated.</p>
26/// <p>A qualified state machine ARN can either refer to a <i>Distributed Map state</i> defined within a state machine, a version ARN, or an alias ARN.</p>
27/// <p>The following are some examples of qualified and unqualified state machine ARNs:</p>
28/// <ul>
29/// <li>
30/// <p>The following qualified state machine ARN refers to a <i>Distributed Map state</i> with a label <code>mapStateLabel</code> in a state machine named <code>myStateMachine</code>.</p>
31/// <p><code>arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel</code></p><note>
32/// <p>If you provide a qualified state machine ARN that refers to a <i>Distributed Map state</i>, the request fails with <code>ValidationException</code>.</p>
33/// </note></li>
34/// <li>
35/// <p>The following unqualified state machine ARN refers to a state machine named <code>myStateMachine</code>.</p>
36/// <p><code>arn:partition:states:region:account-id:stateMachine:myStateMachine</code></p></li>
37/// </ul>
38/// <p>This API action also deletes all <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">versions</a> and <a href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html">aliases</a> associated with a state machine.</p><note>
39/// <p>For <code>EXPRESS</code> state machines, the deletion happens eventually (usually in less than a minute). Running executions may emit logs after <code>DeleteStateMachine</code> API is called.</p>
40/// </note>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct DeleteStateMachineFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::delete_state_machine::builders::DeleteStateMachineInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::delete_state_machine::DeleteStateMachineOutput,
50        crate::operation::delete_state_machine::DeleteStateMachineError,
51    > for DeleteStateMachineFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::delete_state_machine::DeleteStateMachineOutput,
59            crate::operation::delete_state_machine::DeleteStateMachineError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl DeleteStateMachineFluentBuilder {
66    /// Creates a new `DeleteStateMachineFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the DeleteStateMachine as a reference.
75    pub fn as_input(&self) -> &crate::operation::delete_state_machine::builders::DeleteStateMachineInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::delete_state_machine::DeleteStateMachineOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::delete_state_machine::DeleteStateMachineError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::delete_state_machine::DeleteStateMachine::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::delete_state_machine::DeleteStateMachine::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::delete_state_machine::DeleteStateMachineOutput,
112        crate::operation::delete_state_machine::DeleteStateMachineError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The Amazon Resource Name (ARN) of the state machine to delete.</p>
127    pub fn state_machine_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.state_machine_arn(input.into());
129        self
130    }
131    /// <p>The Amazon Resource Name (ARN) of the state machine to delete.</p>
132    pub fn set_state_machine_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_state_machine_arn(input);
134        self
135    }
136    /// <p>The Amazon Resource Name (ARN) of the state machine to delete.</p>
137    pub fn get_state_machine_arn(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_state_machine_arn()
139    }
140}