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