aws_sdk_proton/operation/create_environment_template/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_environment_template::_create_environment_template_output::CreateEnvironmentTemplateOutputBuilder;
3
4pub use crate::operation::create_environment_template::_create_environment_template_input::CreateEnvironmentTemplateInputBuilder;
5
6impl crate::operation::create_environment_template::builders::CreateEnvironmentTemplateInputBuilder {
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::create_environment_template::CreateEnvironmentTemplateOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_environment_template::CreateEnvironmentTemplateError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_environment_template();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateEnvironmentTemplate`.
24///
25/// <p>Create an environment template for Proton. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-templates.html">Environment Templates</a> in the <i>Proton User Guide</i>.</p>
26/// <p>You can create an environment template in one of the two following ways:</p>
27/// <ul>
28/// <li>
29/// <p>Register and publish a <i>standard</i> environment template that instructs Proton to deploy and manage environment infrastructure.</p></li>
30/// <li>
31/// <p>Register and publish a <i>customer managed</i> environment template that connects Proton to your existing provisioned infrastructure that you manage. Proton <i>doesn't</i> manage your existing provisioned infrastructure. To create an environment template for customer provisioned and managed infrastructure, include the <code>provisioning</code> parameter and set the value to <code>CUSTOMER_MANAGED</code>. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/template-create.html">Register and publish an environment template</a> in the <i>Proton User Guide</i>.</p></li>
32/// </ul>
33#[deprecated(note = "AWS Proton is not accepting new customers.", since = "10/07/2025")]
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct CreateEnvironmentTemplateFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::create_environment_template::builders::CreateEnvironmentTemplateInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
43        crate::operation::create_environment_template::CreateEnvironmentTemplateError,
44    > for CreateEnvironmentTemplateFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
52            crate::operation::create_environment_template::CreateEnvironmentTemplateError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl CreateEnvironmentTemplateFluentBuilder {
59    /// Creates a new `CreateEnvironmentTemplateFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the CreateEnvironmentTemplate as a reference.
68    pub fn as_input(&self) -> &crate::operation::create_environment_template::builders::CreateEnvironmentTemplateInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::create_environment_template::CreateEnvironmentTemplateError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::create_environment_template::CreateEnvironmentTemplate::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::create_environment_template::CreateEnvironmentTemplate::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
105        crate::operation::create_environment_template::CreateEnvironmentTemplateError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The name of the environment template.</p>
120    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.name(input.into());
122        self
123    }
124    /// <p>The name of the environment template.</p>
125    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_name(input);
127        self
128    }
129    /// <p>The name of the environment template.</p>
130    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_name()
132    }
133    /// <p>The environment template name as displayed in the developer interface.</p>
134    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.display_name(input.into());
136        self
137    }
138    /// <p>The environment template name as displayed in the developer interface.</p>
139    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_display_name(input);
141        self
142    }
143    /// <p>The environment template name as displayed in the developer interface.</p>
144    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_display_name()
146    }
147    /// <p>A description of the environment template.</p>
148    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.description(input.into());
150        self
151    }
152    /// <p>A description of the environment template.</p>
153    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_description(input);
155        self
156    }
157    /// <p>A description of the environment template.</p>
158    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_description()
160    }
161    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
162    pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.encryption_key(input.into());
164        self
165    }
166    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
167    pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_encryption_key(input);
169        self
170    }
171    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
172    pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_encryption_key()
174    }
175    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
176    pub fn provisioning(mut self, input: crate::types::Provisioning) -> Self {
177        self.inner = self.inner.provisioning(input);
178        self
179    }
180    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
181    pub fn set_provisioning(mut self, input: ::std::option::Option<crate::types::Provisioning>) -> Self {
182        self.inner = self.inner.set_provisioning(input);
183        self
184    }
185    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
186    pub fn get_provisioning(&self) -> &::std::option::Option<crate::types::Provisioning> {
187        self.inner.get_provisioning()
188    }
189    ///
190    /// Appends an item to `tags`.
191    ///
192    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
193    ///
194    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
195    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
196    pub fn tags(mut self, input: crate::types::Tag) -> Self {
197        self.inner = self.inner.tags(input);
198        self
199    }
200    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
201    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
202    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
203        self.inner = self.inner.set_tags(input);
204        self
205    }
206    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
207    /// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
208    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
209        self.inner.get_tags()
210    }
211}