aws_sdk_cloudformation/operation/detect_stack_set_drift/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::detect_stack_set_drift::_detect_stack_set_drift_output::DetectStackSetDriftOutputBuilder;
3
4pub use crate::operation::detect_stack_set_drift::_detect_stack_set_drift_input::DetectStackSetDriftInputBuilder;
5
6impl crate::operation::detect_stack_set_drift::builders::DetectStackSetDriftInputBuilder {
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::detect_stack_set_drift::DetectStackSetDriftOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::detect_stack_set_drift::DetectStackSetDriftError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.detect_stack_set_drift();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DetectStackSetDrift`.
24///
25/// <p>Detect drift on a stack set. When CloudFormation performs drift detection on a stack set, it performs drift detection on the stack associated with each stack instance in the stack set. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html">Performing drift detection on CloudFormation StackSets</a>.</p>
26/// <p><code>DetectStackSetDrift</code> returns the <code>OperationId</code> of the stack set drift detection operation. Use this operation id with <code>DescribeStackSetOperation</code> to monitor the progress of the drift detection operation. The drift detection operation may take some time, depending on the number of stack instances included in the stack set, in addition to the number of resources included in each stack.</p>
27/// <p>Once the operation has completed, use the following actions to return drift information:</p>
28/// <ul>
29/// <li>
30/// <p>Use <code>DescribeStackSet</code> to return detailed information about the stack set, including detailed information about the last <i>completed</i> drift operation performed on the stack set. (Information about drift operations that are in progress isn't included.)</p></li>
31/// <li>
32/// <p>Use <code>ListStackInstances</code> to return a list of stack instances belonging to the stack set, including the drift status and last drift time checked of each instance.</p></li>
33/// <li>
34/// <p>Use <code>DescribeStackInstance</code> to return detailed information about a specific stack instance, including its drift status and last drift time checked.</p></li>
35/// </ul>
36/// <p>You can only run a single drift detection operation on a given stack set at one time.</p>
37/// <p>To stop a drift detection stack set operation, use <code>StopStackSetOperation</code>.</p>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct DetectStackSetDriftFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::detect_stack_set_drift::builders::DetectStackSetDriftInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::detect_stack_set_drift::DetectStackSetDriftOutput,
47        crate::operation::detect_stack_set_drift::DetectStackSetDriftError,
48    > for DetectStackSetDriftFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::detect_stack_set_drift::DetectStackSetDriftOutput,
56            crate::operation::detect_stack_set_drift::DetectStackSetDriftError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl DetectStackSetDriftFluentBuilder {
63    /// Creates a new `DetectStackSetDriftFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the DetectStackSetDrift as a reference.
72    pub fn as_input(&self) -> &crate::operation::detect_stack_set_drift::builders::DetectStackSetDriftInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::detect_stack_set_drift::DetectStackSetDriftOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::detect_stack_set_drift::DetectStackSetDriftError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::detect_stack_set_drift::DetectStackSetDrift::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::detect_stack_set_drift::DetectStackSetDrift::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::detect_stack_set_drift::DetectStackSetDriftOutput,
109        crate::operation::detect_stack_set_drift::DetectStackSetDriftError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The name of the stack set on which to perform the drift detection operation.</p>
124    pub fn stack_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.stack_set_name(input.into());
126        self
127    }
128    /// <p>The name of the stack set on which to perform the drift detection operation.</p>
129    pub fn set_stack_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_stack_set_name(input);
131        self
132    }
133    /// <p>The name of the stack set on which to perform the drift detection operation.</p>
134    pub fn get_stack_set_name(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_stack_set_name()
136    }
137    /// <p>The user-specified preferences for how CloudFormation performs a stack set operation.</p>
138    /// <p>For more information about maximum concurrent accounts and failure tolerance, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html#stackset-ops-options">Stack set operation options</a>.</p>
139    pub fn operation_preferences(mut self, input: crate::types::StackSetOperationPreferences) -> Self {
140        self.inner = self.inner.operation_preferences(input);
141        self
142    }
143    /// <p>The user-specified preferences for how CloudFormation performs a stack set operation.</p>
144    /// <p>For more information about maximum concurrent accounts and failure tolerance, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html#stackset-ops-options">Stack set operation options</a>.</p>
145    pub fn set_operation_preferences(mut self, input: ::std::option::Option<crate::types::StackSetOperationPreferences>) -> Self {
146        self.inner = self.inner.set_operation_preferences(input);
147        self
148    }
149    /// <p>The user-specified preferences for how CloudFormation performs a stack set operation.</p>
150    /// <p>For more information about maximum concurrent accounts and failure tolerance, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/what-is-cfnstacksets.html#stackset-ops-options">Stack set operation options</a>.</p>
151    pub fn get_operation_preferences(&self) -> &::std::option::Option<crate::types::StackSetOperationPreferences> {
152        self.inner.get_operation_preferences()
153    }
154    /// <p><i>The ID of the stack set operation.</i></p>
155    pub fn operation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.inner = self.inner.operation_id(input.into());
157        self
158    }
159    /// <p><i>The ID of the stack set operation.</i></p>
160    pub fn set_operation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_operation_id(input);
162        self
163    }
164    /// <p><i>The ID of the stack set operation.</i></p>
165    pub fn get_operation_id(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_operation_id()
167    }
168    /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
169    /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for stack sets with self-managed permissions.</p>
170    /// <ul>
171    /// <li>
172    /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
173    /// <li>
174    /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
175    /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
176    /// </ul>
177    pub fn call_as(mut self, input: crate::types::CallAs) -> Self {
178        self.inner = self.inner.call_as(input);
179        self
180    }
181    /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
182    /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for stack sets with self-managed permissions.</p>
183    /// <ul>
184    /// <li>
185    /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
186    /// <li>
187    /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
188    /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
189    /// </ul>
190    pub fn set_call_as(mut self, input: ::std::option::Option<crate::types::CallAs>) -> Self {
191        self.inner = self.inner.set_call_as(input);
192        self
193    }
194    /// <p>\[Service-managed permissions\] Specifies whether you are acting as an account administrator in the organization's management account or as a delegated administrator in a member account.</p>
195    /// <p>By default, <code>SELF</code> is specified. Use <code>SELF</code> for stack sets with self-managed permissions.</p>
196    /// <ul>
197    /// <li>
198    /// <p>If you are signed in to the management account, specify <code>SELF</code>.</p></li>
199    /// <li>
200    /// <p>If you are signed in to a delegated administrator account, specify <code>DELEGATED_ADMIN</code>.</p>
201    /// <p>Your Amazon Web Services account must be registered as a delegated administrator in the management account. For more information, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-delegated-admin.html">Register a delegated administrator</a> in the <i>CloudFormation User Guide</i>.</p></li>
202    /// </ul>
203    pub fn get_call_as(&self) -> &::std::option::Option<crate::types::CallAs> {
204        self.inner.get_call_as()
205    }
206}