aws_sdk_proton/operation/update_service_instance/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_service_instance::_update_service_instance_output::UpdateServiceInstanceOutputBuilder;
3
4pub use crate::operation::update_service_instance::_update_service_instance_input::UpdateServiceInstanceInputBuilder;
5
6impl crate::operation::update_service_instance::builders::UpdateServiceInstanceInputBuilder {
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_service_instance::UpdateServiceInstanceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_service_instance::UpdateServiceInstanceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_service_instance();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateServiceInstance`.
24///
25/// <p>Update a service instance.</p>
26/// <p>There are a few modes for updating a service instance. The <code>deploymentType</code> field defines the mode.</p><note>
27/// <p>You can't update a service instance while its deployment status, or the deployment status of a component attached to it, is <code>IN_PROGRESS</code>.</p>
28/// <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>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct UpdateServiceInstanceFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::update_service_instance::builders::UpdateServiceInstanceInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::update_service_instance::UpdateServiceInstanceOutput,
39 crate::operation::update_service_instance::UpdateServiceInstanceError,
40 > for UpdateServiceInstanceFluentBuilder
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_service_instance::UpdateServiceInstanceOutput,
48 crate::operation::update_service_instance::UpdateServiceInstanceError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl UpdateServiceInstanceFluentBuilder {
55 /// Creates a new `UpdateServiceInstanceFluentBuilder`.
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 UpdateServiceInstance as a reference.
64 pub fn as_input(&self) -> &crate::operation::update_service_instance::builders::UpdateServiceInstanceInputBuilder {
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_service_instance::UpdateServiceInstanceOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::update_service_instance::UpdateServiceInstanceError,
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_service_instance::UpdateServiceInstance::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::update_service_instance::UpdateServiceInstance::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_service_instance::UpdateServiceInstanceOutput,
101 crate::operation::update_service_instance::UpdateServiceInstanceError,
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 service instance 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 service instance 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 service instance to update.</p>
126 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
127 self.inner.get_name()
128 }
129 /// <p>The name of the service that the service instance belongs to.</p>
130 pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131 self.inner = self.inner.service_name(input.into());
132 self
133 }
134 /// <p>The name of the service that the service instance belongs to.</p>
135 pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.inner = self.inner.set_service_name(input);
137 self
138 }
139 /// <p>The name of the service that the service instance belongs to.</p>
140 pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
141 self.inner.get_service_name()
142 }
143 /// <p>The deployment type. It defines the mode for updating a service instance, as follows:</p>
144 /// <dl>
145 /// <dt></dt>
146 /// <dd>
147 /// <p><code>NONE</code></p>
148 /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
149 /// </dd>
150 /// <dt></dt>
151 /// <dd>
152 /// <p><code>CURRENT_VERSION</code></p>
153 /// <p>In this mode, the service instance 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 deployment type.</p>
154 /// </dd>
155 /// <dt></dt>
156 /// <dd>
157 /// <p><code>MINOR_VERSION</code></p>
158 /// <p>In this mode, the service instance 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>
159 /// </dd>
160 /// <dt></dt>
161 /// <dd>
162 /// <p><code>MAJOR_VERSION</code></p>
163 /// <p>In this mode, the service instance is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can specify a different major version that's higher than the major version in use and a minor version.</p>
164 /// </dd>
165 /// </dl>
166 pub fn deployment_type(mut self, input: crate::types::DeploymentUpdateType) -> Self {
167 self.inner = self.inner.deployment_type(input);
168 self
169 }
170 /// <p>The deployment type. It defines the mode for updating a service instance, as follows:</p>
171 /// <dl>
172 /// <dt></dt>
173 /// <dd>
174 /// <p><code>NONE</code></p>
175 /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
176 /// </dd>
177 /// <dt></dt>
178 /// <dd>
179 /// <p><code>CURRENT_VERSION</code></p>
180 /// <p>In this mode, the service instance 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 deployment type.</p>
181 /// </dd>
182 /// <dt></dt>
183 /// <dd>
184 /// <p><code>MINOR_VERSION</code></p>
185 /// <p>In this mode, the service instance 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>
186 /// </dd>
187 /// <dt></dt>
188 /// <dd>
189 /// <p><code>MAJOR_VERSION</code></p>
190 /// <p>In this mode, the service instance is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can specify a different major version that's higher than the major version in use and a minor version.</p>
191 /// </dd>
192 /// </dl>
193 pub fn set_deployment_type(mut self, input: ::std::option::Option<crate::types::DeploymentUpdateType>) -> Self {
194 self.inner = self.inner.set_deployment_type(input);
195 self
196 }
197 /// <p>The deployment type. It defines the mode for updating a service instance, as follows:</p>
198 /// <dl>
199 /// <dt></dt>
200 /// <dd>
201 /// <p><code>NONE</code></p>
202 /// <p>In this mode, a deployment <i>doesn't</i> occur. Only the requested metadata parameters are updated.</p>
203 /// </dd>
204 /// <dt></dt>
205 /// <dd>
206 /// <p><code>CURRENT_VERSION</code></p>
207 /// <p>In this mode, the service instance 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 deployment type.</p>
208 /// </dd>
209 /// <dt></dt>
210 /// <dd>
211 /// <p><code>MINOR_VERSION</code></p>
212 /// <p>In this mode, the service instance 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>
213 /// </dd>
214 /// <dt></dt>
215 /// <dd>
216 /// <p><code>MAJOR_VERSION</code></p>
217 /// <p>In this mode, the service instance is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can specify a different major version that's higher than the major version in use and a minor version.</p>
218 /// </dd>
219 /// </dl>
220 pub fn get_deployment_type(&self) -> &::std::option::Option<crate::types::DeploymentUpdateType> {
221 self.inner.get_deployment_type()
222 }
223 /// <p>The formatted specification that defines the service instance update.</p>
224 pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225 self.inner = self.inner.spec(input.into());
226 self
227 }
228 /// <p>The formatted specification that defines the service instance update.</p>
229 pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230 self.inner = self.inner.set_spec(input);
231 self
232 }
233 /// <p>The formatted specification that defines the service instance update.</p>
234 pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
235 self.inner.get_spec()
236 }
237 /// <p>The major version of the service template to update.</p>
238 pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239 self.inner = self.inner.template_major_version(input.into());
240 self
241 }
242 /// <p>The major version of the service template to update.</p>
243 pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244 self.inner = self.inner.set_template_major_version(input);
245 self
246 }
247 /// <p>The major version of the service template to update.</p>
248 pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
249 self.inner.get_template_major_version()
250 }
251 /// <p>The minor version of the service template to update.</p>
252 pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
253 self.inner = self.inner.template_minor_version(input.into());
254 self
255 }
256 /// <p>The minor version of the service template to update.</p>
257 pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258 self.inner = self.inner.set_template_minor_version(input);
259 self
260 }
261 /// <p>The minor version of the service template to update.</p>
262 pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
263 self.inner.get_template_minor_version()
264 }
265 /// <p>The client token of the service instance to update.</p>
266 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267 self.inner = self.inner.client_token(input.into());
268 self
269 }
270 /// <p>The client token of the service instance to update.</p>
271 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.inner = self.inner.set_client_token(input);
273 self
274 }
275 /// <p>The client token of the service instance to update.</p>
276 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
277 self.inner.get_client_token()
278 }
279}