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    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.stack_name(input.into());
123        self
124    }
125    /// <p>The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:</p>
126    /// <ul>
127    /// <li>
128    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
129    /// <li>
130    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
131    /// </ul>
132    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_stack_name(input);
134        self
135    }
136    /// <p>The name or the unique stack ID that's associated with the stack, which aren't always interchangeable:</p>
137    /// <ul>
138    /// <li>
139    /// <p>Running stacks: You can specify either the stack's name or its unique stack ID.</p></li>
140    /// <li>
141    /// <p>Deleted stacks: You must specify the unique stack ID.</p></li>
142    /// </ul>
143    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_stack_name()
145    }
146    /// <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>
147    pub fn change_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.change_set_name(input.into());
149        self
150    }
151    /// <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>
152    pub fn set_change_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_change_set_name(input);
154        self
155    }
156    /// <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>
157    pub fn get_change_set_name(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_change_set_name()
159    }
160    /// <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>
161    /// <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>
162    pub fn template_stage(mut self, input: crate::types::TemplateStage) -> Self {
163        self.inner = self.inner.template_stage(input);
164        self
165    }
166    /// <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>
167    /// <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>
168    pub fn set_template_stage(mut self, input: ::std::option::Option<crate::types::TemplateStage>) -> Self {
169        self.inner = self.inner.set_template_stage(input);
170        self
171    }
172    /// <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>
173    /// <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>
174    pub fn get_template_stage(&self) -> &::std::option::Option<crate::types::TemplateStage> {
175        self.inner.get_template_stage()
176    }
177}