aws_sdk_proton/operation/update_environment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_environment::_update_environment_output::UpdateEnvironmentOutputBuilder;
3
4pub use crate::operation::update_environment::_update_environment_input::UpdateEnvironmentInputBuilder;
5
6impl crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
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::update_environment::UpdateEnvironmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_environment::UpdateEnvironmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_environment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateEnvironment`.
24///
25/// <p>Update an environment.</p>
26/// <p>If the environment is associated with an environment account connection, <i>don't</i> update or include the <code>protonServiceRoleArn</code> and <code>provisioningRepository</code> parameter to update or connect to an environment account connection.</p>
27/// <p>You can only update to a new environment account connection if that connection was created in the same environment account that the current environment account connection was created in. The account connection must also be associated with the current environment.</p>
28/// <p>If the environment <i>isn't</i> associated with an environment account connection, <i>don't</i> update or include the <code>environmentAccountConnectionId</code> parameter. You <i>can't</i> update or connect the environment to an environment account connection if it <i>isn't</i> already associated with an environment connection.</p>
29/// <p>You can update either the <code>environmentAccountConnectionId</code> or <code>protonServiceRoleArn</code> parameter and value. You can’t update both.</p>
30/// <p>If the environment was configured for Amazon Web Services-managed provisioning, omit the <code>provisioningRepository</code> parameter.</p>
31/// <p>If the environment was configured for self-managed provisioning, specify the <code>provisioningRepository</code> parameter and omit the <code>protonServiceRoleArn</code> and <code>environmentAccountConnectionId</code> parameters.</p>
32/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-environments.html">Environments</a> and <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-works-prov-methods.html">Provisioning methods</a> in the <i>Proton User Guide</i>.</p>
33/// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
34/// <dl>
35/// <dt></dt>
36/// <dd>
37/// <p><code>NONE</code></p>
38/// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
39/// </dd>
40/// <dt></dt>
41/// <dd>
42/// <p><code>CURRENT_VERSION</code></p>
43/// <p>In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. <i>Don’t</i> include minor or major version parameters when you use this <code>deployment-type</code>.</p>
44/// </dd>
45/// <dt></dt>
46/// <dd>
47/// <p><code>MINOR_VERSION</code></p>
48/// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.</p>
49/// </dd>
50/// <dt></dt>
51/// <dd>
52/// <p><code>MAJOR_VERSION</code></p>
53/// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that's higher than the major version in use and a minor version.</p>
54/// </dd>
55/// </dl>
56#[derive(::std::clone::Clone, ::std::fmt::Debug)]
57pub struct UpdateEnvironmentFluentBuilder {
58    handle: ::std::sync::Arc<crate::client::Handle>,
59    inner: crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder,
60    config_override: ::std::option::Option<crate::config::Builder>,
61}
62impl
63    crate::client::customize::internal::CustomizableSend<
64        crate::operation::update_environment::UpdateEnvironmentOutput,
65        crate::operation::update_environment::UpdateEnvironmentError,
66    > for UpdateEnvironmentFluentBuilder
67{
68    fn send(
69        self,
70        config_override: crate::config::Builder,
71    ) -> crate::client::customize::internal::BoxFuture<
72        crate::client::customize::internal::SendResult<
73            crate::operation::update_environment::UpdateEnvironmentOutput,
74            crate::operation::update_environment::UpdateEnvironmentError,
75        >,
76    > {
77        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
78    }
79}
80impl UpdateEnvironmentFluentBuilder {
81    /// Creates a new `UpdateEnvironmentFluentBuilder`.
82    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
83        Self {
84            handle,
85            inner: ::std::default::Default::default(),
86            config_override: ::std::option::Option::None,
87        }
88    }
89    /// Access the UpdateEnvironment as a reference.
90    pub fn as_input(&self) -> &crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
91        &self.inner
92    }
93    /// Sends the request and returns the response.
94    ///
95    /// If an error occurs, an `SdkError` will be returned with additional details that
96    /// can be matched against.
97    ///
98    /// By default, any retryable failures will be retried twice. Retry behavior
99    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
100    /// set when configuring the client.
101    pub async fn send(
102        self,
103    ) -> ::std::result::Result<
104        crate::operation::update_environment::UpdateEnvironmentOutput,
105        ::aws_smithy_runtime_api::client::result::SdkError<
106            crate::operation::update_environment::UpdateEnvironmentError,
107            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
108        >,
109    > {
110        let input = self
111            .inner
112            .build()
113            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
114        let runtime_plugins = crate::operation::update_environment::UpdateEnvironment::operation_runtime_plugins(
115            self.handle.runtime_plugins.clone(),
116            &self.handle.conf,
117            self.config_override,
118        );
119        crate::operation::update_environment::UpdateEnvironment::orchestrate(&runtime_plugins, input).await
120    }
121
122    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
123    pub fn customize(
124        self,
125    ) -> crate::client::customize::CustomizableOperation<
126        crate::operation::update_environment::UpdateEnvironmentOutput,
127        crate::operation::update_environment::UpdateEnvironmentError,
128        Self,
129    > {
130        crate::client::customize::CustomizableOperation::new(self)
131    }
132    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
133        self.set_config_override(::std::option::Option::Some(config_override.into()));
134        self
135    }
136
137    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
138        self.config_override = config_override;
139        self
140    }
141    /// <p>The name of the environment to update.</p>
142    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.name(input.into());
144        self
145    }
146    /// <p>The name of the environment to update.</p>
147    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_name(input);
149        self
150    }
151    /// <p>The name of the environment to update.</p>
152    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_name()
154    }
155    /// <p>A description of the environment update.</p>
156    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.description(input.into());
158        self
159    }
160    /// <p>A description of the environment update.</p>
161    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_description(input);
163        self
164    }
165    /// <p>A description of the environment update.</p>
166    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_description()
168    }
169    /// <p>The formatted specification that defines the update.</p>
170    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.spec(input.into());
172        self
173    }
174    /// <p>The formatted specification that defines the update.</p>
175    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_spec(input);
177        self
178    }
179    /// <p>The formatted specification that defines the update.</p>
180    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_spec()
182    }
183    /// <p>The major version of the environment to update.</p>
184    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.template_major_version(input.into());
186        self
187    }
188    /// <p>The major version of the environment to update.</p>
189    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_template_major_version(input);
191        self
192    }
193    /// <p>The major version of the environment to update.</p>
194    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_template_major_version()
196    }
197    /// <p>The minor version of the environment to update.</p>
198    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.template_minor_version(input.into());
200        self
201    }
202    /// <p>The minor version of the environment to update.</p>
203    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_template_minor_version(input);
205        self
206    }
207    /// <p>The minor version of the environment to update.</p>
208    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_template_minor_version()
210    }
211    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
212    pub fn proton_service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.proton_service_role_arn(input.into());
214        self
215    }
216    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
217    pub fn set_proton_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_proton_service_role_arn(input);
219        self
220    }
221    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
222    pub fn get_proton_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_proton_service_role_arn()
224    }
225    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
226    /// <dl>
227    /// <dt></dt>
228    /// <dd>
229    /// <p><code>NONE</code></p>
230    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
231    /// </dd>
232    /// <dt></dt>
233    /// <dd>
234    /// <p><code>CURRENT_VERSION</code></p>
235    /// <p>In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. <i>Don’t</i> include major or minor version parameters when you use this <code>deployment-type</code>.</p>
236    /// </dd>
237    /// <dt></dt>
238    /// <dd>
239    /// <p><code>MINOR_VERSION</code></p>
240    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.</p>
241    /// </dd>
242    /// <dt></dt>
243    /// <dd>
244    /// <p><code>MAJOR_VERSION</code></p>
245    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).</p>
246    /// </dd>
247    /// </dl>
248    pub fn deployment_type(mut self, input: crate::types::DeploymentUpdateType) -> Self {
249        self.inner = self.inner.deployment_type(input);
250        self
251    }
252    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
253    /// <dl>
254    /// <dt></dt>
255    /// <dd>
256    /// <p><code>NONE</code></p>
257    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
258    /// </dd>
259    /// <dt></dt>
260    /// <dd>
261    /// <p><code>CURRENT_VERSION</code></p>
262    /// <p>In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. <i>Don’t</i> include major or minor version parameters when you use this <code>deployment-type</code>.</p>
263    /// </dd>
264    /// <dt></dt>
265    /// <dd>
266    /// <p><code>MINOR_VERSION</code></p>
267    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.</p>
268    /// </dd>
269    /// <dt></dt>
270    /// <dd>
271    /// <p><code>MAJOR_VERSION</code></p>
272    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).</p>
273    /// </dd>
274    /// </dl>
275    pub fn set_deployment_type(mut self, input: ::std::option::Option<crate::types::DeploymentUpdateType>) -> Self {
276        self.inner = self.inner.set_deployment_type(input);
277        self
278    }
279    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
280    /// <dl>
281    /// <dt></dt>
282    /// <dd>
283    /// <p><code>NONE</code></p>
284    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
285    /// </dd>
286    /// <dt></dt>
287    /// <dd>
288    /// <p><code>CURRENT_VERSION</code></p>
289    /// <p>In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. <i>Don’t</i> include major or minor version parameters when you use this <code>deployment-type</code>.</p>
290    /// </dd>
291    /// <dt></dt>
292    /// <dd>
293    /// <p><code>MINOR_VERSION</code></p>
294    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.</p>
295    /// </dd>
296    /// <dt></dt>
297    /// <dd>
298    /// <p><code>MAJOR_VERSION</code></p>
299    /// <p>In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).</p>
300    /// </dd>
301    /// </dl>
302    pub fn get_deployment_type(&self) -> &::std::option::Option<crate::types::DeploymentUpdateType> {
303        self.inner.get_deployment_type()
304    }
305    /// <p>The ID of the environment account connection.</p>
306    /// <p>You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.</p>
307    pub fn environment_account_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308        self.inner = self.inner.environment_account_connection_id(input.into());
309        self
310    }
311    /// <p>The ID of the environment account connection.</p>
312    /// <p>You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.</p>
313    pub fn set_environment_account_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
314        self.inner = self.inner.set_environment_account_connection_id(input);
315        self
316    }
317    /// <p>The ID of the environment account connection.</p>
318    /// <p>You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.</p>
319    pub fn get_environment_account_connection_id(&self) -> &::std::option::Option<::std::string::String> {
320        self.inner.get_environment_account_connection_id()
321    }
322    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
323    pub fn provisioning_repository(mut self, input: crate::types::RepositoryBranchInput) -> Self {
324        self.inner = self.inner.provisioning_repository(input);
325        self
326    }
327    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
328    pub fn set_provisioning_repository(mut self, input: ::std::option::Option<crate::types::RepositoryBranchInput>) -> Self {
329        self.inner = self.inner.set_provisioning_repository(input);
330        self
331    }
332    /// <p>The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see <code>CreateRepository</code>.</p>
333    pub fn get_provisioning_repository(&self) -> &::std::option::Option<crate::types::RepositoryBranchInput> {
334        self.inner.get_provisioning_repository()
335    }
336    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
337    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
338    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
339    pub fn component_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.inner = self.inner.component_role_arn(input.into());
341        self
342    }
343    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
344    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
345    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
346    pub fn set_component_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
347        self.inner = self.inner.set_component_role_arn(input);
348        self
349    }
350    /// <p>The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.</p>
351    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
352    /// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
353    pub fn get_component_role_arn(&self) -> &::std::option::Option<::std::string::String> {
354        self.inner.get_component_role_arn()
355    }
356    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
357    pub fn codebuild_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
358        self.inner = self.inner.codebuild_role_arn(input.into());
359        self
360    }
361    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
362    pub fn set_codebuild_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
363        self.inner = self.inner.set_codebuild_role_arn(input);
364        self
365    }
366    /// <p>The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.</p>
367    pub fn get_codebuild_role_arn(&self) -> &::std::option::Option<::std::string::String> {
368        self.inner.get_codebuild_role_arn()
369    }
370}