aws_sdk_ssm/operation/register_target_with_maintenance_window/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::register_target_with_maintenance_window::_register_target_with_maintenance_window_output::RegisterTargetWithMaintenanceWindowOutputBuilder;
3
4pub use crate::operation::register_target_with_maintenance_window::_register_target_with_maintenance_window_input::RegisterTargetWithMaintenanceWindowInputBuilder;
5
6impl crate::operation::register_target_with_maintenance_window::builders::RegisterTargetWithMaintenanceWindowInputBuilder {
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::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.register_target_with_maintenance_window();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RegisterTargetWithMaintenanceWindow`.
24///
25/// <p>Registers a target with a maintenance window.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct RegisterTargetWithMaintenanceWindowFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::register_target_with_maintenance_window::builders::RegisterTargetWithMaintenanceWindowInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowOutput,
35 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowError,
36 > for RegisterTargetWithMaintenanceWindowFluentBuilder
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::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowOutput,
44 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl RegisterTargetWithMaintenanceWindowFluentBuilder {
51 /// Creates a new `RegisterTargetWithMaintenanceWindowFluentBuilder`.
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 RegisterTargetWithMaintenanceWindow as a reference.
60 pub fn as_input(&self) -> &crate::operation::register_target_with_maintenance_window::builders::RegisterTargetWithMaintenanceWindowInputBuilder {
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::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowError,
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 =
85 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindow::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindow::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowOutput,
98 crate::operation::register_target_with_maintenance_window::RegisterTargetWithMaintenanceWindowError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The ID of the maintenance window the target should be registered with.</p>
113 pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.window_id(input.into());
115 self
116 }
117 /// <p>The ID of the maintenance window the target should be registered with.</p>
118 pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_window_id(input);
120 self
121 }
122 /// <p>The ID of the maintenance window the target should be registered with.</p>
123 pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_window_id()
125 }
126 /// <p>The type of target being registered with the maintenance window.</p>
127 pub fn resource_type(mut self, input: crate::types::MaintenanceWindowResourceType) -> Self {
128 self.inner = self.inner.resource_type(input);
129 self
130 }
131 /// <p>The type of target being registered with the maintenance window.</p>
132 pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowResourceType>) -> Self {
133 self.inner = self.inner.set_resource_type(input);
134 self
135 }
136 /// <p>The type of target being registered with the maintenance window.</p>
137 pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::MaintenanceWindowResourceType> {
138 self.inner.get_resource_type()
139 }
140 ///
141 /// Appends an item to `Targets`.
142 ///
143 /// To override the contents of this collection use [`set_targets`](Self::set_targets).
144 ///
145 /// <p>The targets to register with the maintenance window. In other words, the managed nodes to run commands on when the maintenance window runs.</p><note>
146 /// <p>If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task must run on multiple targets at the same time, register a task for each target individually and assign each task the same priority level.</p>
147 /// </note>
148 /// <p>You can specify targets using managed node IDs, resource group names, or tags that have been applied to managed nodes.</p>
149 /// <p><b>Example 1</b>: Specify managed node IDs</p>
150 /// <p><code>Key=InstanceIds,Values=<instance-id-1>
151 /// ,
152 /// <instance-id-2>
153 /// ,
154 /// <instance-id-3></instance-id-3>
155 /// </instance-id-2>
156 /// </instance-id-1></code></p>
157 /// <p><b>Example 2</b>: Use tag key-pairs applied to managed nodes</p>
158 /// <p><code>Key=tag:<my-tag-key>
159 /// ,Values=
160 /// <my-tag-value-1>
161 /// ,
162 /// <my-tag-value-2></my-tag-value-2>
163 /// </my-tag-value-1>
164 /// </my-tag-key></code></p>
165 /// <p><b>Example 3</b>: Use tag-keys applied to managed nodes</p>
166 /// <p><code>Key=tag-key,Values=<my-tag-key-1>
167 /// ,
168 /// <my-tag-key-2></my-tag-key-2>
169 /// </my-tag-key-1></code></p>
170 /// <p><b>Example 4</b>: Use resource group names</p>
171 /// <p><code>Key=resource-groups:Name,Values=<resource-group-name></resource-group-name></code></p>
172 /// <p><b>Example 5</b>: Use filters for resource group types</p>
173 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>
174 /// ,
175 /// <resource-type-2></resource-type-2>
176 /// </resource-type-1></code></p><note>
177 /// <p>For <code>Key=resource-groups:ResourceTypeFilters</code>, specify resource types in the following format</p>
178 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC</code></p>
179 /// </note>
180 /// <p>For more information about these examples formats, including the best use case for each one, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html">Examples: Register targets with a maintenance window</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
181 pub fn targets(mut self, input: crate::types::Target) -> Self {
182 self.inner = self.inner.targets(input);
183 self
184 }
185 /// <p>The targets to register with the maintenance window. In other words, the managed nodes to run commands on when the maintenance window runs.</p><note>
186 /// <p>If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task must run on multiple targets at the same time, register a task for each target individually and assign each task the same priority level.</p>
187 /// </note>
188 /// <p>You can specify targets using managed node IDs, resource group names, or tags that have been applied to managed nodes.</p>
189 /// <p><b>Example 1</b>: Specify managed node IDs</p>
190 /// <p><code>Key=InstanceIds,Values=<instance-id-1>
191 /// ,
192 /// <instance-id-2>
193 /// ,
194 /// <instance-id-3></instance-id-3>
195 /// </instance-id-2>
196 /// </instance-id-1></code></p>
197 /// <p><b>Example 2</b>: Use tag key-pairs applied to managed nodes</p>
198 /// <p><code>Key=tag:<my-tag-key>
199 /// ,Values=
200 /// <my-tag-value-1>
201 /// ,
202 /// <my-tag-value-2></my-tag-value-2>
203 /// </my-tag-value-1>
204 /// </my-tag-key></code></p>
205 /// <p><b>Example 3</b>: Use tag-keys applied to managed nodes</p>
206 /// <p><code>Key=tag-key,Values=<my-tag-key-1>
207 /// ,
208 /// <my-tag-key-2></my-tag-key-2>
209 /// </my-tag-key-1></code></p>
210 /// <p><b>Example 4</b>: Use resource group names</p>
211 /// <p><code>Key=resource-groups:Name,Values=<resource-group-name></resource-group-name></code></p>
212 /// <p><b>Example 5</b>: Use filters for resource group types</p>
213 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>
214 /// ,
215 /// <resource-type-2></resource-type-2>
216 /// </resource-type-1></code></p><note>
217 /// <p>For <code>Key=resource-groups:ResourceTypeFilters</code>, specify resource types in the following format</p>
218 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC</code></p>
219 /// </note>
220 /// <p>For more information about these examples formats, including the best use case for each one, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html">Examples: Register targets with a maintenance window</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
221 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
222 self.inner = self.inner.set_targets(input);
223 self
224 }
225 /// <p>The targets to register with the maintenance window. In other words, the managed nodes to run commands on when the maintenance window runs.</p><note>
226 /// <p>If a single maintenance window task is registered with multiple targets, its task invocations occur sequentially and not in parallel. If your task must run on multiple targets at the same time, register a task for each target individually and assign each task the same priority level.</p>
227 /// </note>
228 /// <p>You can specify targets using managed node IDs, resource group names, or tags that have been applied to managed nodes.</p>
229 /// <p><b>Example 1</b>: Specify managed node IDs</p>
230 /// <p><code>Key=InstanceIds,Values=<instance-id-1>
231 /// ,
232 /// <instance-id-2>
233 /// ,
234 /// <instance-id-3></instance-id-3>
235 /// </instance-id-2>
236 /// </instance-id-1></code></p>
237 /// <p><b>Example 2</b>: Use tag key-pairs applied to managed nodes</p>
238 /// <p><code>Key=tag:<my-tag-key>
239 /// ,Values=
240 /// <my-tag-value-1>
241 /// ,
242 /// <my-tag-value-2></my-tag-value-2>
243 /// </my-tag-value-1>
244 /// </my-tag-key></code></p>
245 /// <p><b>Example 3</b>: Use tag-keys applied to managed nodes</p>
246 /// <p><code>Key=tag-key,Values=<my-tag-key-1>
247 /// ,
248 /// <my-tag-key-2></my-tag-key-2>
249 /// </my-tag-key-1></code></p>
250 /// <p><b>Example 4</b>: Use resource group names</p>
251 /// <p><code>Key=resource-groups:Name,Values=<resource-group-name></resource-group-name></code></p>
252 /// <p><b>Example 5</b>: Use filters for resource group types</p>
253 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=<resource-type-1>
254 /// ,
255 /// <resource-type-2></resource-type-2>
256 /// </resource-type-1></code></p><note>
257 /// <p>For <code>Key=resource-groups:ResourceTypeFilters</code>, specify resource types in the following format</p>
258 /// <p><code>Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC</code></p>
259 /// </note>
260 /// <p>For more information about these examples formats, including the best use case for each one, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/mw-cli-tutorial-targets-examples.html">Examples: Register targets with a maintenance window</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
261 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
262 self.inner.get_targets()
263 }
264 /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
265 pub fn owner_information(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266 self.inner = self.inner.owner_information(input.into());
267 self
268 }
269 /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
270 pub fn set_owner_information(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271 self.inner = self.inner.set_owner_information(input);
272 self
273 }
274 /// <p>User-provided value that will be included in any Amazon CloudWatch Events events raised while running tasks for these targets in this maintenance window.</p>
275 pub fn get_owner_information(&self) -> &::std::option::Option<::std::string::String> {
276 self.inner.get_owner_information()
277 }
278 /// <p>An optional name for the target.</p>
279 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280 self.inner = self.inner.name(input.into());
281 self
282 }
283 /// <p>An optional name for the target.</p>
284 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
285 self.inner = self.inner.set_name(input);
286 self
287 }
288 /// <p>An optional name for the target.</p>
289 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
290 self.inner.get_name()
291 }
292 /// <p>An optional description for the target.</p>
293 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
294 self.inner = self.inner.description(input.into());
295 self
296 }
297 /// <p>An optional description for the target.</p>
298 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
299 self.inner = self.inner.set_description(input);
300 self
301 }
302 /// <p>An optional description for the target.</p>
303 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
304 self.inner.get_description()
305 }
306 /// <p>User-provided idempotency token.</p>
307 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
308 self.inner = self.inner.client_token(input.into());
309 self
310 }
311 /// <p>User-provided idempotency token.</p>
312 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
313 self.inner = self.inner.set_client_token(input);
314 self
315 }
316 /// <p>User-provided idempotency token.</p>
317 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
318 self.inner.get_client_token()
319 }
320}