aws_sdk_cloudformation/operation/cancel_update_stack/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::cancel_update_stack::_cancel_update_stack_output::CancelUpdateStackOutputBuilder;
3
4pub use crate::operation::cancel_update_stack::_cancel_update_stack_input::CancelUpdateStackInputBuilder;
5
6impl crate::operation::cancel_update_stack::builders::CancelUpdateStackInputBuilder {
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::cancel_update_stack::CancelUpdateStackOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::cancel_update_stack::CancelUpdateStackError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.cancel_update_stack();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CancelUpdateStack`.
24///
25/// <p>Cancels an update on the specified stack. If the call completes successfully, the stack rolls back the update and reverts to the previous stack configuration.</p><note>
26/// <p>You can cancel only stacks that are in the <code>UPDATE_IN_PROGRESS</code> state.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CancelUpdateStackFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::cancel_update_stack::builders::CancelUpdateStackInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::cancel_update_stack::CancelUpdateStackOutput,
37        crate::operation::cancel_update_stack::CancelUpdateStackError,
38    > for CancelUpdateStackFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::cancel_update_stack::CancelUpdateStackOutput,
46            crate::operation::cancel_update_stack::CancelUpdateStackError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CancelUpdateStackFluentBuilder {
53    /// Creates a new `CancelUpdateStackFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CancelUpdateStack as a reference.
62    pub fn as_input(&self) -> &crate::operation::cancel_update_stack::builders::CancelUpdateStackInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::cancel_update_stack::CancelUpdateStackOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::cancel_update_stack::CancelUpdateStackError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::cancel_update_stack::CancelUpdateStack::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::cancel_update_stack::CancelUpdateStack::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::cancel_update_stack::CancelUpdateStackOutput,
99        crate::operation::cancel_update_stack::CancelUpdateStackError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <note>
114    /// <p>If you don't pass a parameter to <code>StackName</code>, the API returns a response that describes all resources in the account.</p>
115    /// <p>The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:</p>
116    /// <p><code>{ "Version": "2012-10-17", "Statement": \[{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:*:*:stack/*/*" }\] }</code></p>
117    /// </note>
118    /// <p>The name or the unique stack ID that's associated with the stack.</p>
119    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.stack_name(input.into());
121        self
122    }
123    /// <note>
124    /// <p>If you don't pass a parameter to <code>StackName</code>, the API returns a response that describes all resources in the account.</p>
125    /// <p>The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:</p>
126    /// <p><code>{ "Version": "2012-10-17", "Statement": \[{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:*:*:stack/*/*" }\] }</code></p>
127    /// </note>
128    /// <p>The name or the unique stack ID that's associated with the stack.</p>
129    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_stack_name(input);
131        self
132    }
133    /// <note>
134    /// <p>If you don't pass a parameter to <code>StackName</code>, the API returns a response that describes all resources in the account.</p>
135    /// <p>The IAM policy below can be added to IAM policies when you want to limit resource-level permissions and avoid returning a response when no parameter is sent in the request:</p>
136    /// <p><code>{ "Version": "2012-10-17", "Statement": \[{ "Effect": "Deny", "Action": "cloudformation:DescribeStacks", "NotResource": "arn:aws:cloudformation:*:*:stack/*/*" }\] }</code></p>
137    /// </note>
138    /// <p>The name or the unique stack ID that's associated with the stack.</p>
139    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_stack_name()
141    }
142    /// <p>A unique identifier for this <code>CancelUpdateStack</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to cancel an update on a stack with the same name. You might retry <code>CancelUpdateStack</code> requests to ensure that CloudFormation successfully received them.</p>
143    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.client_request_token(input.into());
145        self
146    }
147    /// <p>A unique identifier for this <code>CancelUpdateStack</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to cancel an update on a stack with the same name. You might retry <code>CancelUpdateStack</code> requests to ensure that CloudFormation successfully received them.</p>
148    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_client_request_token(input);
150        self
151    }
152    /// <p>A unique identifier for this <code>CancelUpdateStack</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to cancel an update on a stack with the same name. You might retry <code>CancelUpdateStack</code> requests to ensure that CloudFormation successfully received them.</p>
153    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_client_request_token()
155    }
156}