aws_sdk_cloudformation/operation/describe_stack_resources/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_stack_resources::_describe_stack_resources_output::DescribeStackResourcesOutputBuilder;
3
4pub use crate::operation::describe_stack_resources::_describe_stack_resources_input::DescribeStackResourcesInputBuilder;
5
6impl crate::operation::describe_stack_resources::builders::DescribeStackResourcesInputBuilder {
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::describe_stack_resources::DescribeStackResourcesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_stack_resources::DescribeStackResourcesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_stack_resources();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeStackResources`.
24///
25/// <p>Returns Amazon Web Services resource descriptions for running and deleted stacks. If <code>StackName</code> is specified, all the associated resources that are part of the stack are returned. If <code>PhysicalResourceId</code> is specified, the associated resources of the stack that the resource belongs to are returned.</p><note>
26/// <p>Only the first 100 resources will be returned. If your stack has more resources than this, you should use <code>ListStackResources</code> instead.</p>
27/// </note>
28/// <p>For deleted stacks, <code>DescribeStackResources</code> returns resource information for up to 90 days after the stack has been deleted.</p>
29/// <p>You must specify either <code>StackName</code> or <code>PhysicalResourceId</code>, but not both. In addition, you can specify <code>LogicalResourceId</code> to filter the returned result. For more information about resources, the <code>LogicalResourceId</code> and <code>PhysicalResourceId</code>, see the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/">CloudFormation User Guide</a>.</p><note>
30/// <p>A <code>ValidationError</code> is returned if you specify both <code>StackName</code> and <code>PhysicalResourceId</code> in the same request.</p>
31/// </note>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct DescribeStackResourcesFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::describe_stack_resources::builders::DescribeStackResourcesInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::describe_stack_resources::DescribeStackResourcesOutput,
41        crate::operation::describe_stack_resources::DescribeStackResourcesError,
42    > for DescribeStackResourcesFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::describe_stack_resources::DescribeStackResourcesOutput,
50            crate::operation::describe_stack_resources::DescribeStackResourcesError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl DescribeStackResourcesFluentBuilder {
57    /// Creates a new `DescribeStackResourcesFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the DescribeStackResources as a reference.
66    pub fn as_input(&self) -> &crate::operation::describe_stack_resources::builders::DescribeStackResourcesInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::describe_stack_resources::DescribeStackResourcesOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::describe_stack_resources::DescribeStackResourcesError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::describe_stack_resources::DescribeStackResources::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::describe_stack_resources::DescribeStackResources::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::describe_stack_resources::DescribeStackResourcesOutput,
103        crate::operation::describe_stack_resources::DescribeStackResourcesError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The name or the unique stack ID that is associated with the stack, which aren't always interchangeable:</p>
118    /// <ul>
119    /// <li>
120    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
121    /// <li>
122    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
123    /// </ul>
124    /// <p>Required: Conditional. If you don't specify <code>StackName</code>, you must specify <code>PhysicalResourceId</code>.</p>
125    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.stack_name(input.into());
127        self
128    }
129    /// <p>The name or the unique stack ID that is associated with the stack, which aren't always interchangeable:</p>
130    /// <ul>
131    /// <li>
132    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
133    /// <li>
134    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
135    /// </ul>
136    /// <p>Required: Conditional. If you don't specify <code>StackName</code>, you must specify <code>PhysicalResourceId</code>.</p>
137    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_stack_name(input);
139        self
140    }
141    /// <p>The name or the unique stack ID that is associated with the stack, which aren't always interchangeable:</p>
142    /// <ul>
143    /// <li>
144    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
145    /// <li>
146    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
147    /// </ul>
148    /// <p>Required: Conditional. If you don't specify <code>StackName</code>, you must specify <code>PhysicalResourceId</code>.</p>
149    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_stack_name()
151    }
152    /// <p>The logical name of the resource as specified in the template.</p>
153    pub fn logical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.logical_resource_id(input.into());
155        self
156    }
157    /// <p>The logical name of the resource as specified in the template.</p>
158    pub fn set_logical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_logical_resource_id(input);
160        self
161    }
162    /// <p>The logical name of the resource as specified in the template.</p>
163    pub fn get_logical_resource_id(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_logical_resource_id()
165    }
166    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
167    /// <p>For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack.</p>
168    /// <p>Required: Conditional. If you don't specify <code>PhysicalResourceId</code>, you must specify <code>StackName</code>.</p>
169    pub fn physical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.physical_resource_id(input.into());
171        self
172    }
173    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
174    /// <p>For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack.</p>
175    /// <p>Required: Conditional. If you don't specify <code>PhysicalResourceId</code>, you must specify <code>StackName</code>.</p>
176    pub fn set_physical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_physical_resource_id(input);
178        self
179    }
180    /// <p>The name or unique identifier that corresponds to a physical instance ID of a resource supported by CloudFormation.</p>
181    /// <p>For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack.</p>
182    /// <p>Required: Conditional. If you don't specify <code>PhysicalResourceId</code>, you must specify <code>StackName</code>.</p>
183    pub fn get_physical_resource_id(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_physical_resource_id()
185    }
186}