aws_sdk_cloudformation/operation/get_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_template::_get_template_output::GetTemplateOutputBuilder;
3
4pub use crate::operation::get_template::_get_template_input::GetTemplateInputBuilder;
5
6impl crate::operation::get_template::builders::GetTemplateInputBuilder {
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::get_template::GetTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_template::GetTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetTemplate`.
24///
25/// <p>Returns the template body for a specified stack. You can get the template for running or deleted stacks.</p>
26/// <p>For deleted stacks, <code>GetTemplate</code> returns the template for up to 90 days after the stack has been deleted.</p><note>
27/// <p>If the template doesn't exist, a <code>ValidationError</code> is returned.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct GetTemplateFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::get_template::builders::GetTemplateInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::get_template::GetTemplateOutput,
38        crate::operation::get_template::GetTemplateError,
39    > for GetTemplateFluentBuilder
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::get_template::GetTemplateOutput,
47            crate::operation::get_template::GetTemplateError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl GetTemplateFluentBuilder {
54    /// Creates a new `GetTemplateFluentBuilder`.
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 GetTemplate as a reference.
63    pub fn as_input(&self) -> &crate::operation::get_template::builders::GetTemplateInputBuilder {
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::get_template::GetTemplateOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::get_template::GetTemplateError,
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::get_template::GetTemplate::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::get_template::GetTemplate::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::get_template::GetTemplateOutput,
100        crate::operation::get_template::GetTemplateError,
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 the unique stack ID that's associated with the stack, which aren't always interchangeable:</p>
115    /// <ul>
116    /// <li>
117    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
118    /// <li>
119    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
120    /// </ul>
121    /// <p>Default: There is no default value.</p>
122    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.stack_name(input.into());
124        self
125    }
126    /// <p>The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:</p>
127    /// <ul>
128    /// <li>
129    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
130    /// <li>
131    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
132    /// </ul>
133    /// <p>Default: There is no default value.</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>The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:</p>
139    /// <ul>
140    /// <li>
141    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
142    /// <li>
143    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
144    /// </ul>
145    /// <p>Default: There is no default value.</p>
146    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_stack_name()
148    }
149    /// <p>The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated template. If you specify a name, you must also specify the <code>StackName</code>.</p>
150    pub fn change_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.change_set_name(input.into());
152        self
153    }
154    /// <p>The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated template. If you specify a name, you must also specify the <code>StackName</code>.</p>
155    pub fn set_change_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_change_set_name(input);
157        self
158    }
159    /// <p>The name or Amazon Resource Name (ARN) of a change set for which CloudFormation returns the associated template. If you specify a name, you must also specify the <code>StackName</code>.</p>
160    pub fn get_change_set_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_change_set_name()
162    }
163    /// <p>For templates that include transforms, the stage of the template that CloudFormation returns. To get the user-submitted template, specify <code>Original</code>. To get the template after CloudFormation has processed all transforms, specify <code>Processed</code>.</p>
164    /// <p>If the template doesn't include transforms, <code>Original</code> and <code>Processed</code> return the same template. By default, CloudFormation specifies <code>Processed</code>.</p>
165    pub fn template_stage(mut self, input: crate::types::TemplateStage) -> Self {
166        self.inner = self.inner.template_stage(input);
167        self
168    }
169    /// <p>For templates that include transforms, the stage of the template that CloudFormation returns. To get the user-submitted template, specify <code>Original</code>. To get the template after CloudFormation has processed all transforms, specify <code>Processed</code>.</p>
170    /// <p>If the template doesn't include transforms, <code>Original</code> and <code>Processed</code> return the same template. By default, CloudFormation specifies <code>Processed</code>.</p>
171    pub fn set_template_stage(mut self, input: ::std::option::Option<crate::types::TemplateStage>) -> Self {
172        self.inner = self.inner.set_template_stage(input);
173        self
174    }
175    /// <p>For templates that include transforms, the stage of the template that CloudFormation returns. To get the user-submitted template, specify <code>Original</code>. To get the template after CloudFormation has processed all transforms, specify <code>Processed</code>.</p>
176    /// <p>If the template doesn't include transforms, <code>Original</code> and <code>Processed</code> return the same template. By default, CloudFormation specifies <code>Processed</code>.</p>
177    pub fn get_template_stage(&self) -> &::std::option::Option<crate::types::TemplateStage> {
178        self.inner.get_template_stage()
179    }
180}