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
// 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 GetTaskProtectionOutput {
/// <p>A list of tasks with the following information.</p>
/// <ul>
/// <li>
/// <p><code>taskArn</code>: The task ARN.</p></li>
/// <li>
/// <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>
/// <li>
/// <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li>
/// </ul>
pub protected_tasks: ::std::option::Option<::std::vec::Vec<crate::types::ProtectedTask>>,
/// <p>Any failures associated with the call.</p>
pub failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
_request_id: Option<String>,
}
impl GetTaskProtectionOutput {
/// <p>A list of tasks with the following information.</p>
/// <ul>
/// <li>
/// <p><code>taskArn</code>: The task ARN.</p></li>
/// <li>
/// <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>
/// <li>
/// <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li>
/// </ul>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.protected_tasks.is_none()`.
pub fn protected_tasks(&self) -> &[crate::types::ProtectedTask] {
self.protected_tasks.as_deref().unwrap_or_default()
}
/// <p>Any failures associated with the call.</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 `.failures.is_none()`.
pub fn failures(&self) -> &[crate::types::Failure] {
self.failures.as_deref().unwrap_or_default()
}
}
impl ::aws_types::request_id::RequestId for GetTaskProtectionOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetTaskProtectionOutput {
/// Creates a new builder-style object to manufacture [`GetTaskProtectionOutput`](crate::operation::get_task_protection::GetTaskProtectionOutput).
pub fn builder() -> crate::operation::get_task_protection::builders::GetTaskProtectionOutputBuilder {
crate::operation::get_task_protection::builders::GetTaskProtectionOutputBuilder::default()
}
}
/// A builder for [`GetTaskProtectionOutput`](crate::operation::get_task_protection::GetTaskProtectionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetTaskProtectionOutputBuilder {
pub(crate) protected_tasks: ::std::option::Option<::std::vec::Vec<crate::types::ProtectedTask>>,
pub(crate) failures: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>,
_request_id: Option<String>,
}
impl GetTaskProtectionOutputBuilder {
/// Appends an item to `protected_tasks`.
///
/// To override the contents of this collection use [`set_protected_tasks`](Self::set_protected_tasks).
///
/// <p>A list of tasks with the following information.</p>
/// <ul>
/// <li>
/// <p><code>taskArn</code>: The task ARN.</p></li>
/// <li>
/// <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>
/// <li>
/// <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li>
/// </ul>
pub fn protected_tasks(mut self, input: crate::types::ProtectedTask) -> Self {
let mut v = self.protected_tasks.unwrap_or_default();
v.push(input);
self.protected_tasks = ::std::option::Option::Some(v);
self
}
/// <p>A list of tasks with the following information.</p>
/// <ul>
/// <li>
/// <p><code>taskArn</code>: The task ARN.</p></li>
/// <li>
/// <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>
/// <li>
/// <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li>
/// </ul>
pub fn set_protected_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProtectedTask>>) -> Self {
self.protected_tasks = input;
self
}
/// <p>A list of tasks with the following information.</p>
/// <ul>
/// <li>
/// <p><code>taskArn</code>: The task ARN.</p></li>
/// <li>
/// <p><code>protectionEnabled</code>: The protection status of the task. If scale-in protection is turned on for a task, the value is <code>true</code>. Otherwise, it is <code>false</code>.</p></li>
/// <li>
/// <p><code>expirationDate</code>: The epoch time when protection for the task will expire.</p></li>
/// </ul>
pub fn get_protected_tasks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProtectedTask>> {
&self.protected_tasks
}
/// Appends an item to `failures`.
///
/// To override the contents of this collection use [`set_failures`](Self::set_failures).
///
/// <p>Any failures associated with the call.</p>
pub fn failures(mut self, input: crate::types::Failure) -> Self {
let mut v = self.failures.unwrap_or_default();
v.push(input);
self.failures = ::std::option::Option::Some(v);
self
}
/// <p>Any failures associated with the call.</p>
pub fn set_failures(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Failure>>) -> Self {
self.failures = input;
self
}
/// <p>Any failures associated with the call.</p>
pub fn get_failures(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Failure>> {
&self.failures
}
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 [`GetTaskProtectionOutput`](crate::operation::get_task_protection::GetTaskProtectionOutput).
pub fn build(self) -> crate::operation::get_task_protection::GetTaskProtectionOutput {
crate::operation::get_task_protection::GetTaskProtectionOutput {
protected_tasks: self.protected_tasks,
failures: self.failures,
_request_id: self._request_id,
}
}
}