1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartCapacityTaskOutput {
/// <p>ID of the capacity task that you want to start.</p>
pub capacity_task_id: ::std::option::Option<::std::string::String>,
/// <p>ID of the Outpost associated with the capacity task.</p>
pub outpost_id: ::std::option::Option<::std::string::String>,
/// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
pub order_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub asset_id: ::std::option::Option<::std::string::String>,
/// <p>List of the instance pools requested in the specified capacity task.</p>
pub requested_instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
/// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
/// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
pub dry_run: bool,
/// <p>Status of the specified capacity task.</p>
pub capacity_task_status: ::std::option::Option<crate::types::CapacityTaskStatus>,
/// <p>Reason that the specified capacity task failed.</p>
pub failed: ::std::option::Option<crate::types::CapacityTaskFailure>,
/// <p>Date that the specified capacity task was created.</p>
pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>Date that the specified capacity task ran successfully.</p>
pub completion_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>Date that the specified capacity task was last modified.</p>
pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
_request_id: Option<String>,
}
impl StartCapacityTaskOutput {
/// <p>ID of the capacity task that you want to start.</p>
pub fn capacity_task_id(&self) -> ::std::option::Option<&str> {
self.capacity_task_id.as_deref()
}
/// <p>ID of the Outpost associated with the capacity task.</p>
pub fn outpost_id(&self) -> ::std::option::Option<&str> {
self.outpost_id.as_deref()
}
/// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
pub fn order_id(&self) -> ::std::option::Option<&str> {
self.order_id.as_deref()
}
/// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn asset_id(&self) -> ::std::option::Option<&str> {
self.asset_id.as_deref()
}
/// <p>List of the instance pools requested in the specified capacity task.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.requested_instance_pools.is_none()`.
pub fn requested_instance_pools(&self) -> &[crate::types::InstanceTypeCapacity] {
self.requested_instance_pools.as_deref().unwrap_or_default()
}
/// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn instances_to_exclude(&self) -> ::std::option::Option<&crate::types::InstancesToExclude> {
self.instances_to_exclude.as_ref()
}
/// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
pub fn dry_run(&self) -> bool {
self.dry_run
}
/// <p>Status of the specified capacity task.</p>
pub fn capacity_task_status(&self) -> ::std::option::Option<&crate::types::CapacityTaskStatus> {
self.capacity_task_status.as_ref()
}
/// <p>Reason that the specified capacity task failed.</p>
pub fn failed(&self) -> ::std::option::Option<&crate::types::CapacityTaskFailure> {
self.failed.as_ref()
}
/// <p>Date that the specified capacity task was created.</p>
pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>Date that the specified capacity task ran successfully.</p>
pub fn completion_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.completion_date.as_ref()
}
/// <p>Date that the specified capacity task was last modified.</p>
pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_modified_date.as_ref()
}
/// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn task_action_on_blocking_instances(&self) -> ::std::option::Option<&crate::types::TaskActionOnBlockingInstances> {
self.task_action_on_blocking_instances.as_ref()
}
}
impl ::aws_types::request_id::RequestId for StartCapacityTaskOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl StartCapacityTaskOutput {
/// Creates a new builder-style object to manufacture [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
pub fn builder() -> crate::operation::start_capacity_task::builders::StartCapacityTaskOutputBuilder {
crate::operation::start_capacity_task::builders::StartCapacityTaskOutputBuilder::default()
}
}
/// A builder for [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCapacityTaskOutputBuilder {
pub(crate) capacity_task_id: ::std::option::Option<::std::string::String>,
pub(crate) outpost_id: ::std::option::Option<::std::string::String>,
pub(crate) order_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_id: ::std::option::Option<::std::string::String>,
pub(crate) requested_instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
pub(crate) instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) capacity_task_status: ::std::option::Option<crate::types::CapacityTaskStatus>,
pub(crate) failed: ::std::option::Option<crate::types::CapacityTaskFailure>,
pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) completion_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
_request_id: Option<String>,
}
impl StartCapacityTaskOutputBuilder {
/// <p>ID of the capacity task that you want to start.</p>
pub fn capacity_task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.capacity_task_id = ::std::option::Option::Some(input.into());
self
}
/// <p>ID of the capacity task that you want to start.</p>
pub fn set_capacity_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.capacity_task_id = input;
self
}
/// <p>ID of the capacity task that you want to start.</p>
pub fn get_capacity_task_id(&self) -> &::std::option::Option<::std::string::String> {
&self.capacity_task_id
}
/// <p>ID of the Outpost associated with the capacity task.</p>
pub fn outpost_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.outpost_id = ::std::option::Option::Some(input.into());
self
}
/// <p>ID of the Outpost associated with the capacity task.</p>
pub fn set_outpost_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.outpost_id = input;
self
}
/// <p>ID of the Outpost associated with the capacity task.</p>
pub fn get_outpost_id(&self) -> &::std::option::Option<::std::string::String> {
&self.outpost_id
}
/// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
pub fn order_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.order_id = ::std::option::Option::Some(input.into());
self
}
/// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
pub fn set_order_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.order_id = input;
self
}
/// <p>ID of the Amazon Web Services Outposts order of the host associated with the capacity task.</p>
pub fn get_order_id(&self) -> &::std::option::Option<::std::string::String> {
&self.order_id
}
/// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_id = input;
self
}
/// <p>The ID of the asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_id
}
/// Appends an item to `requested_instance_pools`.
///
/// To override the contents of this collection use [`set_requested_instance_pools`](Self::set_requested_instance_pools).
///
/// <p>List of the instance pools requested in the specified capacity task.</p>
pub fn requested_instance_pools(mut self, input: crate::types::InstanceTypeCapacity) -> Self {
let mut v = self.requested_instance_pools.unwrap_or_default();
v.push(input);
self.requested_instance_pools = ::std::option::Option::Some(v);
self
}
/// <p>List of the instance pools requested in the specified capacity task.</p>
pub fn set_requested_instance_pools(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>) -> Self {
self.requested_instance_pools = input;
self
}
/// <p>List of the instance pools requested in the specified capacity task.</p>
pub fn get_requested_instance_pools(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>> {
&self.requested_instance_pools
}
/// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn instances_to_exclude(mut self, input: crate::types::InstancesToExclude) -> Self {
self.instances_to_exclude = ::std::option::Option::Some(input);
self
}
/// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn set_instances_to_exclude(mut self, input: ::std::option::Option<crate::types::InstancesToExclude>) -> Self {
self.instances_to_exclude = input;
self
}
/// <p>User-specified instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn get_instances_to_exclude(&self) -> &::std::option::Option<crate::types::InstancesToExclude> {
&self.instances_to_exclude
}
/// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>Results of the dry run showing if the specified capacity task is above or below the available instance capacity.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>Status of the specified capacity task.</p>
pub fn capacity_task_status(mut self, input: crate::types::CapacityTaskStatus) -> Self {
self.capacity_task_status = ::std::option::Option::Some(input);
self
}
/// <p>Status of the specified capacity task.</p>
pub fn set_capacity_task_status(mut self, input: ::std::option::Option<crate::types::CapacityTaskStatus>) -> Self {
self.capacity_task_status = input;
self
}
/// <p>Status of the specified capacity task.</p>
pub fn get_capacity_task_status(&self) -> &::std::option::Option<crate::types::CapacityTaskStatus> {
&self.capacity_task_status
}
/// <p>Reason that the specified capacity task failed.</p>
pub fn failed(mut self, input: crate::types::CapacityTaskFailure) -> Self {
self.failed = ::std::option::Option::Some(input);
self
}
/// <p>Reason that the specified capacity task failed.</p>
pub fn set_failed(mut self, input: ::std::option::Option<crate::types::CapacityTaskFailure>) -> Self {
self.failed = input;
self
}
/// <p>Reason that the specified capacity task failed.</p>
pub fn get_failed(&self) -> &::std::option::Option<crate::types::CapacityTaskFailure> {
&self.failed
}
/// <p>Date that the specified capacity task was created.</p>
pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_date = ::std::option::Option::Some(input);
self
}
/// <p>Date that the specified capacity task was created.</p>
pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_date = input;
self
}
/// <p>Date that the specified capacity task was created.</p>
pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_date
}
/// <p>Date that the specified capacity task ran successfully.</p>
pub fn completion_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.completion_date = ::std::option::Option::Some(input);
self
}
/// <p>Date that the specified capacity task ran successfully.</p>
pub fn set_completion_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.completion_date = input;
self
}
/// <p>Date that the specified capacity task ran successfully.</p>
pub fn get_completion_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.completion_date
}
/// <p>Date that the specified capacity task was last modified.</p>
pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modified_date = ::std::option::Option::Some(input);
self
}
/// <p>Date that the specified capacity task was last modified.</p>
pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modified_date = input;
self
}
/// <p>Date that the specified capacity task was last modified.</p>
pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modified_date
}
/// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn task_action_on_blocking_instances(mut self, input: crate::types::TaskActionOnBlockingInstances) -> Self {
self.task_action_on_blocking_instances = ::std::option::Option::Some(input);
self
}
/// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn set_task_action_on_blocking_instances(mut self, input: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>) -> Self {
self.task_action_on_blocking_instances = input;
self
}
/// <p>User-specified option in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn get_task_action_on_blocking_instances(&self) -> &::std::option::Option<crate::types::TaskActionOnBlockingInstances> {
&self.task_action_on_blocking_instances
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`StartCapacityTaskOutput`](crate::operation::start_capacity_task::StartCapacityTaskOutput).
pub fn build(self) -> crate::operation::start_capacity_task::StartCapacityTaskOutput {
crate::operation::start_capacity_task::StartCapacityTaskOutput {
capacity_task_id: self.capacity_task_id,
outpost_id: self.outpost_id,
order_id: self.order_id,
asset_id: self.asset_id,
requested_instance_pools: self.requested_instance_pools,
instances_to_exclude: self.instances_to_exclude,
dry_run: self.dry_run.unwrap_or_default(),
capacity_task_status: self.capacity_task_status,
failed: self.failed,
creation_date: self.creation_date,
completion_date: self.completion_date,
last_modified_date: self.last_modified_date,
task_action_on_blocking_instances: self.task_action_on_blocking_instances,
_request_id: self._request_id,
}
}
}