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#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct CreateEnvironmentTemplateFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::create_environment_template::builders::CreateEnvironmentTemplateInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
42        crate::operation::create_environment_template::CreateEnvironmentTemplateError,
43    > for CreateEnvironmentTemplateFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
51            crate::operation::create_environment_template::CreateEnvironmentTemplateError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl CreateEnvironmentTemplateFluentBuilder {
58    /// Creates a new `CreateEnvironmentTemplateFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the CreateEnvironmentTemplate as a reference.
67    pub fn as_input(&self) -> &crate::operation::create_environment_template::builders::CreateEnvironmentTemplateInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::create_environment_template::CreateEnvironmentTemplateError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::create_environment_template::CreateEnvironmentTemplate::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::create_environment_template::CreateEnvironmentTemplate::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::create_environment_template::CreateEnvironmentTemplateOutput,
104        crate::operation::create_environment_template::CreateEnvironmentTemplateError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The name of the environment template.</p>
119    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.name(input.into());
121        self
122    }
123    /// <p>The name of the environment template.</p>
124    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_name(input);
126        self
127    }
128    /// <p>The name of the environment template.</p>
129    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_name()
131    }
132    /// <p>The environment template name as displayed in the developer interface.</p>
133    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.display_name(input.into());
135        self
136    }
137    /// <p>The environment template name as displayed in the developer interface.</p>
138    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_display_name(input);
140        self
141    }
142    /// <p>The environment template name as displayed in the developer interface.</p>
143    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_display_name()
145    }
146    /// <p>A description of the environment template.</p>
147    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.description(input.into());
149        self
150    }
151    /// <p>A description of the environment template.</p>
152    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_description(input);
154        self
155    }
156    /// <p>A description of the environment template.</p>
157    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_description()
159    }
160    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
161    pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.encryption_key(input.into());
163        self
164    }
165    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
166    pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_encryption_key(input);
168        self
169    }
170    /// <p>A customer provided encryption key that Proton uses to encrypt data.</p>
171    pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_encryption_key()
173    }
174    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
175    pub fn provisioning(mut self, input: crate::types::Provisioning) -> Self {
176        self.inner = self.inner.provisioning(input);
177        self
178    }
179    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
180    pub fn set_provisioning(mut self, input: ::std::option::Option<crate::types::Provisioning>) -> Self {
181        self.inner = self.inner.set_provisioning(input);
182        self
183    }
184    /// <p>When included, indicates that the environment template is for customer provisioned and managed infrastructure.</p>
185    pub fn get_provisioning(&self) -> &::std::option::Option<crate::types::Provisioning> {
186        self.inner.get_provisioning()
187    }
188    ///
189    /// Appends an item to `tags`.
190    ///
191    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
192    ///
193    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
194    /// <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>
195    pub fn tags(mut self, input: crate::types::Tag) -> Self {
196        self.inner = self.inner.tags(input);
197        self
198    }
199    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
200    /// <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>
201    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
202        self.inner = self.inner.set_tags(input);
203        self
204    }
205    /// <p>An optional list of metadata items that you can associate with the Proton environment template. A tag is a key-value pair.</p>
206    /// <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>
207    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
208        self.inner.get_tags()
209    }
210}