aws_sdk_cloudformation/operation/execute_change_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::execute_change_set::_execute_change_set_output::ExecuteChangeSetOutputBuilder;
3
4pub use crate::operation::execute_change_set::_execute_change_set_input::ExecuteChangeSetInputBuilder;
5
6impl crate::operation::execute_change_set::builders::ExecuteChangeSetInputBuilder {
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::execute_change_set::ExecuteChangeSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::execute_change_set::ExecuteChangeSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.execute_change_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExecuteChangeSet`.
24///
25/// <p>Updates a stack using the input information that was provided when the specified change set was created. After the call successfully completes, CloudFormation starts updating the stack. Use the <code>DescribeStacks</code> action to view the status of the update.</p>
26/// <p>When you execute a change set, CloudFormation deletes all other change sets associated with the stack because they aren't valid for the updated stack.</p>
27/// <p>If a stack policy is associated with the stack, CloudFormation enforces the policy during the update. You can't specify a temporary stack policy that overrides the current policy.</p>
28/// <p>To create a change set for the entire stack hierarchy, <code>IncludeNestedStacks</code> must have been set to <code>True</code>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct ExecuteChangeSetFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::execute_change_set::builders::ExecuteChangeSetInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::execute_change_set::ExecuteChangeSetOutput,
38        crate::operation::execute_change_set::ExecuteChangeSetError,
39    > for ExecuteChangeSetFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::execute_change_set::ExecuteChangeSetOutput,
47            crate::operation::execute_change_set::ExecuteChangeSetError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl ExecuteChangeSetFluentBuilder {
54    /// Creates a new `ExecuteChangeSetFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the ExecuteChangeSet as a reference.
63    pub fn as_input(&self) -> &crate::operation::execute_change_set::builders::ExecuteChangeSetInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::execute_change_set::ExecuteChangeSetOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::execute_change_set::ExecuteChangeSetError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::execute_change_set::ExecuteChangeSet::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::execute_change_set::ExecuteChangeSet::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::execute_change_set::ExecuteChangeSetOutput,
100        crate::operation::execute_change_set::ExecuteChangeSetError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name or Amazon Resource Name (ARN) of the change set that you want use to update the specified stack.</p>
115    pub fn change_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.change_set_name(input.into());
117        self
118    }
119    /// <p>The name or Amazon Resource Name (ARN) of the change set that you want use to update the specified stack.</p>
120    pub fn set_change_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_change_set_name(input);
122        self
123    }
124    /// <p>The name or Amazon Resource Name (ARN) of the change set that you want use to update the specified stack.</p>
125    pub fn get_change_set_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_change_set_name()
127    }
128    /// <p>If you specified the name of a change set, specify the stack name or Amazon Resource Name (ARN) that's associated with the change set you want to execute.</p>
129    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.stack_name(input.into());
131        self
132    }
133    /// <p>If you specified the name of a change set, specify the stack name or Amazon Resource Name (ARN) that's associated with the change set you want to execute.</p>
134    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_stack_name(input);
136        self
137    }
138    /// <p>If you specified the name of a change set, specify the stack name or Amazon Resource Name (ARN) that's associated with the change set you want to execute.</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>ExecuteChangeSet</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to execute a change set to update a stack with the same name. You might retry <code>ExecuteChangeSet</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>ExecuteChangeSet</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to execute a change set to update a stack with the same name. You might retry <code>ExecuteChangeSet</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>ExecuteChangeSet</code> request. Specify this token if you plan to retry requests so that CloudFormation knows that you're not attempting to execute a change set to update a stack with the same name. You might retry <code>ExecuteChangeSet</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    /// <p>Preserves the state of previously provisioned resources when an operation fails. This parameter can't be specified when the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation was specified.</p>
157    /// <ul>
158    /// <li>
159    /// <p><code>True</code> - if the stack creation fails, do nothing. This is equivalent to specifying <code>DO_NOTHING</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
160    /// <li>
161    /// <p><code>False</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying <code>ROLLBACK</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
162    /// </ul>
163    /// <p>Default: <code>True</code></p>
164    pub fn disable_rollback(mut self, input: bool) -> Self {
165        self.inner = self.inner.disable_rollback(input);
166        self
167    }
168    /// <p>Preserves the state of previously provisioned resources when an operation fails. This parameter can't be specified when the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation was specified.</p>
169    /// <ul>
170    /// <li>
171    /// <p><code>True</code> - if the stack creation fails, do nothing. This is equivalent to specifying <code>DO_NOTHING</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
172    /// <li>
173    /// <p><code>False</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying <code>ROLLBACK</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
174    /// </ul>
175    /// <p>Default: <code>True</code></p>
176    pub fn set_disable_rollback(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.inner = self.inner.set_disable_rollback(input);
178        self
179    }
180    /// <p>Preserves the state of previously provisioned resources when an operation fails. This parameter can't be specified when the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation was specified.</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>True</code> - if the stack creation fails, do nothing. This is equivalent to specifying <code>DO_NOTHING</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
184    /// <li>
185    /// <p><code>False</code> - if the stack creation fails, roll back the stack. This is equivalent to specifying <code>ROLLBACK</code> for the <code>OnStackFailure</code> parameter to the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateChangeSet.html">CreateChangeSet</a> API operation.</p></li>
186    /// </ul>
187    /// <p>Default: <code>True</code></p>
188    pub fn get_disable_rollback(&self) -> &::std::option::Option<bool> {
189        self.inner.get_disable_rollback()
190    }
191    /// <p>When set to <code>true</code>, newly created resources are deleted when the operation rolls back. This includes newly created resources marked with a deletion policy of <code>Retain</code>.</p>
192    /// <p>Default: <code>false</code></p>
193    pub fn retain_except_on_create(mut self, input: bool) -> Self {
194        self.inner = self.inner.retain_except_on_create(input);
195        self
196    }
197    /// <p>When set to <code>true</code>, newly created resources are deleted when the operation rolls back. This includes newly created resources marked with a deletion policy of <code>Retain</code>.</p>
198    /// <p>Default: <code>false</code></p>
199    pub fn set_retain_except_on_create(mut self, input: ::std::option::Option<bool>) -> Self {
200        self.inner = self.inner.set_retain_except_on_create(input);
201        self
202    }
203    /// <p>When set to <code>true</code>, newly created resources are deleted when the operation rolls back. This includes newly created resources marked with a deletion policy of <code>Retain</code>.</p>
204    /// <p>Default: <code>false</code></p>
205    pub fn get_retain_except_on_create(&self) -> &::std::option::Option<bool> {
206        self.inner.get_retain_except_on_create()
207    }
208}