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#[deprecated(note = "AWS Proton is not accepting new customers.", since = "10/07/2025")]
57#[derive(::std::clone::Clone, ::std::fmt::Debug)]
58pub struct UpdateEnvironmentFluentBuilder {
59    handle: ::std::sync::Arc<crate::client::Handle>,
60    inner: crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder,
61    config_override: ::std::option::Option<crate::config::Builder>,
62}
63impl
64    crate::client::customize::internal::CustomizableSend<
65        crate::operation::update_environment::UpdateEnvironmentOutput,
66        crate::operation::update_environment::UpdateEnvironmentError,
67    > for UpdateEnvironmentFluentBuilder
68{
69    fn send(
70        self,
71        config_override: crate::config::Builder,
72    ) -> crate::client::customize::internal::BoxFuture<
73        crate::client::customize::internal::SendResult<
74            crate::operation::update_environment::UpdateEnvironmentOutput,
75            crate::operation::update_environment::UpdateEnvironmentError,
76        >,
77    > {
78        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
79    }
80}
81impl UpdateEnvironmentFluentBuilder {
82    /// Creates a new `UpdateEnvironmentFluentBuilder`.
83    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
84        Self {
85            handle,
86            inner: ::std::default::Default::default(),
87            config_override: ::std::option::Option::None,
88        }
89    }
90    /// Access the UpdateEnvironment as a reference.
91    pub fn as_input(&self) -> &crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
92        &self.inner
93    }
94    /// Sends the request and returns the response.
95    ///
96    /// If an error occurs, an `SdkError` will be returned with additional details that
97    /// can be matched against.
98    ///
99    /// By default, any retryable failures will be retried twice. Retry behavior
100    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
101    /// set when configuring the client.
102    pub async fn send(
103        self,
104    ) -> ::std::result::Result<
105        crate::operation::update_environment::UpdateEnvironmentOutput,
106        ::aws_smithy_runtime_api::client::result::SdkError<
107            crate::operation::update_environment::UpdateEnvironmentError,
108            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
109        >,
110    > {
111        let input = self
112            .inner
113            .build()
114            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
115        let runtime_plugins = crate::operation::update_environment::UpdateEnvironment::operation_runtime_plugins(
116            self.handle.runtime_plugins.clone(),
117            &self.handle.conf,
118            self.config_override,
119        );
120        crate::operation::update_environment::UpdateEnvironment::orchestrate(&runtime_plugins, input).await
121    }
122
123    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
124    pub fn customize(
125        self,
126    ) -> crate::client::customize::CustomizableOperation<
127        crate::operation::update_environment::UpdateEnvironmentOutput,
128        crate::operation::update_environment::UpdateEnvironmentError,
129        Self,
130    > {
131        crate::client::customize::CustomizableOperation::new(self)
132    }
133    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
134        self.set_config_override(::std::option::Option::Some(config_override.into()));
135        self
136    }
137
138    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
139        self.config_override = config_override;
140        self
141    }
142    /// <p>The name of the environment to update.</p>
143    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.name(input.into());
145        self
146    }
147    /// <p>The name of the environment to update.</p>
148    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_name(input);
150        self
151    }
152    /// <p>The name of the environment to update.</p>
153    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_name()
155    }
156    /// <p>A description of the environment update.</p>
157    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.description(input.into());
159        self
160    }
161    /// <p>A description of the environment update.</p>
162    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_description(input);
164        self
165    }
166    /// <p>A description of the environment update.</p>
167    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_description()
169    }
170    /// <p>The formatted specification that defines the update.</p>
171    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.spec(input.into());
173        self
174    }
175    /// <p>The formatted specification that defines the update.</p>
176    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_spec(input);
178        self
179    }
180    /// <p>The formatted specification that defines the update.</p>
181    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_spec()
183    }
184    /// <p>The major version of the environment to update.</p>
185    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.template_major_version(input.into());
187        self
188    }
189    /// <p>The major version of the environment to update.</p>
190    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191        self.inner = self.inner.set_template_major_version(input);
192        self
193    }
194    /// <p>The major version of the environment to update.</p>
195    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
196        self.inner.get_template_major_version()
197    }
198    /// <p>The minor version of the environment to update.</p>
199    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200        self.inner = self.inner.template_minor_version(input.into());
201        self
202    }
203    /// <p>The minor version of the environment to update.</p>
204    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_template_minor_version(input);
206        self
207    }
208    /// <p>The minor version of the environment to update.</p>
209    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
210        self.inner.get_template_minor_version()
211    }
212    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
213    pub fn proton_service_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        self.inner = self.inner.proton_service_role_arn(input.into());
215        self
216    }
217    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
218    pub fn set_proton_service_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
219        self.inner = self.inner.set_proton_service_role_arn(input);
220        self
221    }
222    /// <p>The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.</p>
223    pub fn get_proton_service_role_arn(&self) -> &::std::option::Option<::std::string::String> {
224        self.inner.get_proton_service_role_arn()
225    }
226    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
227    /// <dl>
228    /// <dt></dt>
229    /// <dd>
230    /// <p><code>NONE</code></p>
231    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
232    /// </dd>
233    /// <dt></dt>
234    /// <dd>
235    /// <p><code>CURRENT_VERSION</code></p>
236    /// <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>
237    /// </dd>
238    /// <dt></dt>
239    /// <dd>
240    /// <p><code>MINOR_VERSION</code></p>
241    /// <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>
242    /// </dd>
243    /// <dt></dt>
244    /// <dd>
245    /// <p><code>MAJOR_VERSION</code></p>
246    /// <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>
247    /// </dd>
248    /// </dl>
249    pub fn deployment_type(mut self, input: crate::types::DeploymentUpdateType) -> Self {
250        self.inner = self.inner.deployment_type(input);
251        self
252    }
253    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
254    /// <dl>
255    /// <dt></dt>
256    /// <dd>
257    /// <p><code>NONE</code></p>
258    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
259    /// </dd>
260    /// <dt></dt>
261    /// <dd>
262    /// <p><code>CURRENT_VERSION</code></p>
263    /// <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>
264    /// </dd>
265    /// <dt></dt>
266    /// <dd>
267    /// <p><code>MINOR_VERSION</code></p>
268    /// <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>
269    /// </dd>
270    /// <dt></dt>
271    /// <dd>
272    /// <p><code>MAJOR_VERSION</code></p>
273    /// <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>
274    /// </dd>
275    /// </dl>
276    pub fn set_deployment_type(mut self, input: ::std::option::Option<crate::types::DeploymentUpdateType>) -> Self {
277        self.inner = self.inner.set_deployment_type(input);
278        self
279    }
280    /// <p>There are four modes for updating an environment. The <code>deploymentType</code> field defines the mode.</p>
281    /// <dl>
282    /// <dt></dt>
283    /// <dd>
284    /// <p><code>NONE</code></p>
285    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
286    /// </dd>
287    /// <dt></dt>
288    /// <dd>
289    /// <p><code>CURRENT_VERSION</code></p>
290    /// <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>
291    /// </dd>
292    /// <dt></dt>
293    /// <dd>
294    /// <p><code>MINOR_VERSION</code></p>
295    /// <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>
296    /// </dd>
297    /// <dt></dt>
298    /// <dd>
299    /// <p><code>MAJOR_VERSION</code></p>
300    /// <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>
301    /// </dd>
302    /// </dl>
303    pub fn get_deployment_type(&self) -> &::std::option::Option<crate::types::DeploymentUpdateType> {
304        self.inner.get_deployment_type()
305    }
306    /// <p>The ID of the environment account connection.</p>
307    /// <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>
308    pub fn environment_account_connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
309        self.inner = self.inner.environment_account_connection_id(input.into());
310        self
311    }
312    /// <p>The ID of the environment account connection.</p>
313    /// <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>
314    pub fn set_environment_account_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.inner = self.inner.set_environment_account_connection_id(input);
316        self
317    }
318    /// <p>The ID of the environment account connection.</p>
319    /// <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>
320    pub fn get_environment_account_connection_id(&self) -> &::std::option::Option<::std::string::String> {
321        self.inner.get_environment_account_connection_id()
322    }
323    /// <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>
324    pub fn provisioning_repository(mut self, input: crate::types::RepositoryBranchInput) -> Self {
325        self.inner = self.inner.provisioning_repository(input);
326        self
327    }
328    /// <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>
329    pub fn set_provisioning_repository(mut self, input: ::std::option::Option<crate::types::RepositoryBranchInput>) -> Self {
330        self.inner = self.inner.set_provisioning_repository(input);
331        self
332    }
333    /// <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>
334    pub fn get_provisioning_repository(&self) -> &::std::option::Option<crate::types::RepositoryBranchInput> {
335        self.inner.get_provisioning_repository()
336    }
337    /// <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>
338    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
339    /// <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>
340    pub fn component_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
341        self.inner = self.inner.component_role_arn(input.into());
342        self
343    }
344    /// <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>
345    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
346    /// <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>
347    pub fn set_component_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
348        self.inner = self.inner.set_component_role_arn(input);
349        self
350    }
351    /// <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>
352    /// <p>The environment must have a <code>componentRoleArn</code> to allow directly defined components to be associated with the environment.</p>
353    /// <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>
354    pub fn get_component_role_arn(&self) -> &::std::option::Option<::std::string::String> {
355        self.inner.get_component_role_arn()
356    }
357    /// <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>
358    pub fn codebuild_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
359        self.inner = self.inner.codebuild_role_arn(input.into());
360        self
361    }
362    /// <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>
363    pub fn set_codebuild_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
364        self.inner = self.inner.set_codebuild_role_arn(input);
365        self
366    }
367    /// <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>
368    pub fn get_codebuild_role_arn(&self) -> &::std::option::Option<::std::string::String> {
369        self.inner.get_codebuild_role_arn()
370    }
371}