aws_sdk_imagebuilder/operation/update_infrastructure_configuration/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_infrastructure_configuration::_update_infrastructure_configuration_output::UpdateInfrastructureConfigurationOutputBuilder;
3
4pub use crate::operation::update_infrastructure_configuration::_update_infrastructure_configuration_input::UpdateInfrastructureConfigurationInputBuilder;
5
6impl crate::operation::update_infrastructure_configuration::builders::UpdateInfrastructureConfigurationInputBuilder {
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_infrastructure_configuration::UpdateInfrastructureConfigurationOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_infrastructure_configuration();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateInfrastructureConfiguration`.
24///
25/// <p>Updates a new infrastructure configuration. An infrastructure configuration defines the environment in which your image will be built and tested.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateInfrastructureConfigurationFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_infrastructure_configuration::builders::UpdateInfrastructureConfigurationInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationOutput,
35 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationError,
36 > for UpdateInfrastructureConfigurationFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationOutput,
44 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateInfrastructureConfigurationFluentBuilder {
51 /// Creates a new `UpdateInfrastructureConfigurationFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateInfrastructureConfiguration as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_infrastructure_configuration::builders::UpdateInfrastructureConfigurationInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfiguration::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfiguration::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationOutput,
97 crate::operation::update_infrastructure_configuration::UpdateInfrastructureConfigurationError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.</p>
112 pub fn infrastructure_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.infrastructure_configuration_arn(input.into());
114 self
115 }
116 /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.</p>
117 pub fn set_infrastructure_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_infrastructure_configuration_arn(input);
119 self
120 }
121 /// <p>The Amazon Resource Name (ARN) of the infrastructure configuration that you want to update.</p>
122 pub fn get_infrastructure_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_infrastructure_configuration_arn()
124 }
125 /// <p>The description of the infrastructure configuration.</p>
126 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.description(input.into());
128 self
129 }
130 /// <p>The description of the infrastructure configuration.</p>
131 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_description(input);
133 self
134 }
135 /// <p>The description of the infrastructure configuration.</p>
136 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_description()
138 }
139 ///
140 /// Appends an item to `instanceTypes`.
141 ///
142 /// To override the contents of this collection use [`set_instance_types`](Self::set_instance_types).
143 ///
144 /// <p>The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.</p>
145 pub fn instance_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.instance_types(input.into());
147 self
148 }
149 /// <p>The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.</p>
150 pub fn set_instance_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
151 self.inner = self.inner.set_instance_types(input);
152 self
153 }
154 /// <p>The instance types of the infrastructure configuration. You can specify one or more instance types to use for this build. The service will pick one of these instance types based on availability.</p>
155 pub fn get_instance_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156 self.inner.get_instance_types()
157 }
158 /// <p>The instance profile to associate with the instance used to customize your Amazon EC2 AMI.</p>
159 pub fn instance_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.inner = self.inner.instance_profile_name(input.into());
161 self
162 }
163 /// <p>The instance profile to associate with the instance used to customize your Amazon EC2 AMI.</p>
164 pub fn set_instance_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.inner = self.inner.set_instance_profile_name(input);
166 self
167 }
168 /// <p>The instance profile to associate with the instance used to customize your Amazon EC2 AMI.</p>
169 pub fn get_instance_profile_name(&self) -> &::std::option::Option<::std::string::String> {
170 self.inner.get_instance_profile_name()
171 }
172 ///
173 /// Appends an item to `securityGroupIds`.
174 ///
175 /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
176 ///
177 /// <p>The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.</p>
178 pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179 self.inner = self.inner.security_group_ids(input.into());
180 self
181 }
182 /// <p>The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.</p>
183 pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
184 self.inner = self.inner.set_security_group_ids(input);
185 self
186 }
187 /// <p>The security group IDs to associate with the instance used to customize your Amazon EC2 AMI.</p>
188 pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
189 self.inner.get_security_group_ids()
190 }
191 /// <p>The subnet ID to place the instance used to customize your Amazon EC2 AMI in.</p>
192 pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193 self.inner = self.inner.subnet_id(input.into());
194 self
195 }
196 /// <p>The subnet ID to place the instance used to customize your Amazon EC2 AMI in.</p>
197 pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198 self.inner = self.inner.set_subnet_id(input);
199 self
200 }
201 /// <p>The subnet ID to place the instance used to customize your Amazon EC2 AMI in.</p>
202 pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
203 self.inner.get_subnet_id()
204 }
205 /// <p>The logging configuration of the infrastructure configuration.</p>
206 pub fn logging(mut self, input: crate::types::Logging) -> Self {
207 self.inner = self.inner.logging(input);
208 self
209 }
210 /// <p>The logging configuration of the infrastructure configuration.</p>
211 pub fn set_logging(mut self, input: ::std::option::Option<crate::types::Logging>) -> Self {
212 self.inner = self.inner.set_logging(input);
213 self
214 }
215 /// <p>The logging configuration of the infrastructure configuration.</p>
216 pub fn get_logging(&self) -> &::std::option::Option<crate::types::Logging> {
217 self.inner.get_logging()
218 }
219 /// <p>The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.</p>
220 pub fn key_pair(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221 self.inner = self.inner.key_pair(input.into());
222 self
223 }
224 /// <p>The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.</p>
225 pub fn set_key_pair(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226 self.inner = self.inner.set_key_pair(input);
227 self
228 }
229 /// <p>The key pair of the infrastructure configuration. You can use this to log on to and debug the instance used to create your image.</p>
230 pub fn get_key_pair(&self) -> &::std::option::Option<::std::string::String> {
231 self.inner.get_key_pair()
232 }
233 /// <p>The terminate instance on failure setting of the infrastructure configuration. Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.</p>
234 pub fn terminate_instance_on_failure(mut self, input: bool) -> Self {
235 self.inner = self.inner.terminate_instance_on_failure(input);
236 self
237 }
238 /// <p>The terminate instance on failure setting of the infrastructure configuration. Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.</p>
239 pub fn set_terminate_instance_on_failure(mut self, input: ::std::option::Option<bool>) -> Self {
240 self.inner = self.inner.set_terminate_instance_on_failure(input);
241 self
242 }
243 /// <p>The terminate instance on failure setting of the infrastructure configuration. Set to false if you want Image Builder to retain the instance used to configure your AMI if the build or test phase of your workflow fails.</p>
244 pub fn get_terminate_instance_on_failure(&self) -> &::std::option::Option<bool> {
245 self.inner.get_terminate_instance_on_failure()
246 }
247 /// <p>The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.</p><note>
248 /// <p>EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.</p>
249 /// </note>
250 pub fn sns_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251 self.inner = self.inner.sns_topic_arn(input.into());
252 self
253 }
254 /// <p>The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.</p><note>
255 /// <p>EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.</p>
256 /// </note>
257 pub fn set_sns_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
258 self.inner = self.inner.set_sns_topic_arn(input);
259 self
260 }
261 /// <p>The Amazon Resource Name (ARN) for the SNS topic to which we send image build event notifications.</p><note>
262 /// <p>EC2 Image Builder is unable to send notifications to SNS topics that are encrypted using keys from other accounts. The key that is used to encrypt the SNS topic must reside in the account that the Image Builder service runs under.</p>
263 /// </note>
264 pub fn get_sns_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
265 self.inner.get_sns_topic_arn()
266 }
267 ///
268 /// Adds a key-value pair to `resourceTags`.
269 ///
270 /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
271 ///
272 /// <p>The tags attached to the resource created by Image Builder.</p>
273 pub fn resource_tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
274 self.inner = self.inner.resource_tags(k.into(), v.into());
275 self
276 }
277 /// <p>The tags attached to the resource created by Image Builder.</p>
278 pub fn set_resource_tags(
279 mut self,
280 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
281 ) -> Self {
282 self.inner = self.inner.set_resource_tags(input);
283 self
284 }
285 /// <p>The tags attached to the resource created by Image Builder.</p>
286 pub fn get_resource_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
287 self.inner.get_resource_tags()
288 }
289 /// <p>The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances. For more information about instance metadata options, see one of the following links:</p>
290 /// <ul>
291 /// <li>
292 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 User Guide</i> </i> for Linux instances.</p></li>
293 /// <li>
294 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 Windows Guide</i> </i> for Windows instances.</p></li>
295 /// </ul>
296 pub fn instance_metadata_options(mut self, input: crate::types::InstanceMetadataOptions) -> Self {
297 self.inner = self.inner.instance_metadata_options(input);
298 self
299 }
300 /// <p>The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances. For more information about instance metadata options, see one of the following links:</p>
301 /// <ul>
302 /// <li>
303 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 User Guide</i> </i> for Linux instances.</p></li>
304 /// <li>
305 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 Windows Guide</i> </i> for Windows instances.</p></li>
306 /// </ul>
307 pub fn set_instance_metadata_options(mut self, input: ::std::option::Option<crate::types::InstanceMetadataOptions>) -> Self {
308 self.inner = self.inner.set_instance_metadata_options(input);
309 self
310 }
311 /// <p>The instance metadata options that you can set for the HTTP requests that pipeline builds use to launch EC2 build and test instances. For more information about instance metadata options, see one of the following links:</p>
312 /// <ul>
313 /// <li>
314 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 User Guide</i> </i> for Linux instances.</p></li>
315 /// <li>
316 /// <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/configuring-instance-metadata-options.html">Configure the instance metadata options</a> in the <i> <i>Amazon EC2 Windows Guide</i> </i> for Windows instances.</p></li>
317 /// </ul>
318 pub fn get_instance_metadata_options(&self) -> &::std::option::Option<crate::types::InstanceMetadataOptions> {
319 self.inner.get_instance_metadata_options()
320 }
321 /// <p>The instance placement settings that define where the instances that are launched from your image will run.</p>
322 pub fn placement(mut self, input: crate::types::Placement) -> Self {
323 self.inner = self.inner.placement(input);
324 self
325 }
326 /// <p>The instance placement settings that define where the instances that are launched from your image will run.</p>
327 pub fn set_placement(mut self, input: ::std::option::Option<crate::types::Placement>) -> Self {
328 self.inner = self.inner.set_placement(input);
329 self
330 }
331 /// <p>The instance placement settings that define where the instances that are launched from your image will run.</p>
332 pub fn get_placement(&self) -> &::std::option::Option<crate::types::Placement> {
333 self.inner.get_placement()
334 }
335 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
336 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
337 self.inner = self.inner.client_token(input.into());
338 self
339 }
340 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
341 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
342 self.inner = self.inner.set_client_token(input);
343 self
344 }
345 /// <p>Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a> in the <i>Amazon EC2 API Reference</i>.</p>
346 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
347 self.inner.get_client_token()
348 }
349}