aws_sdk_proton/operation/update_component/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_component::_update_component_output::UpdateComponentOutputBuilder;
3
4pub use crate::operation::update_component::_update_component_input::UpdateComponentInputBuilder;
5
6impl crate::operation::update_component::builders::UpdateComponentInputBuilder {
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_component::UpdateComponentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_component::UpdateComponentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_component();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateComponent`.
24///
25/// <p>Update a component.</p>
26/// <p>There are a few modes for updating a component. The <code>deploymentType</code> field defines the mode.</p><note>
27/// <p>You can't update a component while its deployment status, or the deployment status of a service instance attached to it, is <code>IN_PROGRESS</code>.</p>
28/// </note>
29/// <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>
30#[deprecated(note = "AWS Proton is not accepting new customers.", since = "10/07/2025")]
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct UpdateComponentFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::update_component::builders::UpdateComponentInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::update_component::UpdateComponentOutput,
40        crate::operation::update_component::UpdateComponentError,
41    > for UpdateComponentFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::update_component::UpdateComponentOutput,
49            crate::operation::update_component::UpdateComponentError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl UpdateComponentFluentBuilder {
56    /// Creates a new `UpdateComponentFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the UpdateComponent as a reference.
65    pub fn as_input(&self) -> &crate::operation::update_component::builders::UpdateComponentInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::update_component::UpdateComponentOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::update_component::UpdateComponentError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::update_component::UpdateComponent::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::update_component::UpdateComponent::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::update_component::UpdateComponentOutput,
102        crate::operation::update_component::UpdateComponentError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The name of the component to update.</p>
117    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.name(input.into());
119        self
120    }
121    /// <p>The name of the component to update.</p>
122    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_name(input);
124        self
125    }
126    /// <p>The name of the component to update.</p>
127    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_name()
129    }
130    /// <p>The deployment type. It defines the mode for updating a component, as follows:</p>
131    /// <dl>
132    /// <dt></dt>
133    /// <dd>
134    /// <p><code>NONE</code></p>
135    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated. You can only specify <code>description</code> in this mode.</p>
136    /// </dd>
137    /// <dt></dt>
138    /// <dd>
139    /// <p><code>CURRENT_VERSION</code></p>
140    /// <p>In this mode, the component is deployed and updated with the new <code>serviceSpec</code>, <code>templateSource</code>, and/or <code>type</code> that you provide. Only requested parameters are updated.</p>
141    /// </dd>
142    /// </dl>
143    pub fn deployment_type(mut self, input: crate::types::ComponentDeploymentUpdateType) -> Self {
144        self.inner = self.inner.deployment_type(input);
145        self
146    }
147    /// <p>The deployment type. It defines the mode for updating a component, as follows:</p>
148    /// <dl>
149    /// <dt></dt>
150    /// <dd>
151    /// <p><code>NONE</code></p>
152    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated. You can only specify <code>description</code> in this mode.</p>
153    /// </dd>
154    /// <dt></dt>
155    /// <dd>
156    /// <p><code>CURRENT_VERSION</code></p>
157    /// <p>In this mode, the component is deployed and updated with the new <code>serviceSpec</code>, <code>templateSource</code>, and/or <code>type</code> that you provide. Only requested parameters are updated.</p>
158    /// </dd>
159    /// </dl>
160    pub fn set_deployment_type(mut self, input: ::std::option::Option<crate::types::ComponentDeploymentUpdateType>) -> Self {
161        self.inner = self.inner.set_deployment_type(input);
162        self
163    }
164    /// <p>The deployment type. It defines the mode for updating a component, as follows:</p>
165    /// <dl>
166    /// <dt></dt>
167    /// <dd>
168    /// <p><code>NONE</code></p>
169    /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated. You can only specify <code>description</code> in this mode.</p>
170    /// </dd>
171    /// <dt></dt>
172    /// <dd>
173    /// <p><code>CURRENT_VERSION</code></p>
174    /// <p>In this mode, the component is deployed and updated with the new <code>serviceSpec</code>, <code>templateSource</code>, and/or <code>type</code> that you provide. Only requested parameters are updated.</p>
175    /// </dd>
176    /// </dl>
177    pub fn get_deployment_type(&self) -> &::std::option::Option<crate::types::ComponentDeploymentUpdateType> {
178        self.inner.get_deployment_type()
179    }
180    /// <p>An optional customer-provided description of the component.</p>
181    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182        self.inner = self.inner.description(input.into());
183        self
184    }
185    /// <p>An optional customer-provided description of the component.</p>
186    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187        self.inner = self.inner.set_description(input);
188        self
189    }
190    /// <p>An optional customer-provided description of the component.</p>
191    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
192        self.inner.get_description()
193    }
194    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
195    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.service_name(input.into());
197        self
198    }
199    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
200    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.inner = self.inner.set_service_name(input);
202        self
203    }
204    /// <p>The name of the service that <code>serviceInstanceName</code> is associated with. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
205    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
206        self.inner.get_service_name()
207    }
208    /// <p>The name of the service instance that you want to attach this component to. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
209    pub fn service_instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.service_instance_name(input.into());
211        self
212    }
213    /// <p>The name of the service instance that you want to attach this component to. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
214    pub fn set_service_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.inner = self.inner.set_service_instance_name(input);
216        self
217    }
218    /// <p>The name of the service instance that you want to attach this component to. Don't specify to keep the component's current service instance attachment. Specify an empty string to detach the component from the service instance it's attached to. Specify non-empty values for both <code>serviceInstanceName</code> and <code>serviceName</code> or for neither of them.</p>
219    pub fn get_service_instance_name(&self) -> &::std::option::Option<::std::string::String> {
220        self.inner.get_service_instance_name()
221    }
222    /// <p>The service spec that you want the component to use to access service inputs. Set this only when the component is attached to a service instance.</p>
223    pub fn service_spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.inner = self.inner.service_spec(input.into());
225        self
226    }
227    /// <p>The service spec that you want the component to use to access service inputs. Set this only when the component is attached to a service instance.</p>
228    pub fn set_service_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.inner = self.inner.set_service_spec(input);
230        self
231    }
232    /// <p>The service spec that you want the component to use to access service inputs. Set this only when the component is attached to a service instance.</p>
233    pub fn get_service_spec(&self) -> &::std::option::Option<::std::string::String> {
234        self.inner.get_service_spec()
235    }
236    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
237    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
238    /// </note>
239    pub fn template_file(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.inner = self.inner.template_file(input.into());
241        self
242    }
243    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
244    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
245    /// </note>
246    pub fn set_template_file(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247        self.inner = self.inner.set_template_file(input);
248        self
249    }
250    /// <p>A path to the Infrastructure as Code (IaC) file describing infrastructure that a custom component provisions.</p><note>
251    /// <p>Components support a single IaC file, even if you use Terraform as your template language.</p>
252    /// </note>
253    pub fn get_template_file(&self) -> &::std::option::Option<::std::string::String> {
254        self.inner.get_template_file()
255    }
256    /// <p>The client token for the updated component.</p>
257    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.inner = self.inner.client_token(input.into());
259        self
260    }
261    /// <p>The client token for the updated component.</p>
262    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263        self.inner = self.inner.set_client_token(input);
264        self
265    }
266    /// <p>The client token for the updated component.</p>
267    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
268        self.inner.get_client_token()
269    }
270}