aws_sdk_rbin/operation/get_rule/
_get_rule_output.rs

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
// 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 GetRuleOutput {
    /// <p>The unique ID of the retention rule.</p>
    pub identifier: ::std::option::Option<::std::string::String>,
    /// <p>The retention rule description.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The resource type retained by the retention rule.</p>
    pub resource_type: ::std::option::Option<crate::types::ResourceType>,
    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
    pub retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
    /// <p>Information about the resource tags used to identify resources that are retained by the retention rule.</p>
    pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
    pub status: ::std::option::Option<crate::types::RuleStatus>,
    /// <p>Information about the retention rule lock configuration.</p>
    pub lock_configuration: ::std::option::Option<crate::types::LockConfiguration>,
    /// <p>The lock state for the retention rule.</p>
    /// <ul>
    /// <li>
    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
    /// <li>
    /// <p><code>pending_unlock</code> - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.</p></li>
    /// <li>
    /// <p><code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p></li>
    /// <li>
    /// <p><code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p></li>
    /// </ul>
    pub lock_state: ::std::option::Option<crate::types::LockState>,
    /// <p>The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.</p>
    pub lock_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
    pub rule_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetRuleOutput {
    /// <p>The unique ID of the retention rule.</p>
    pub fn identifier(&self) -> ::std::option::Option<&str> {
        self.identifier.as_deref()
    }
    /// <p>The retention rule description.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The resource type retained by the retention rule.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
        self.resource_type.as_ref()
    }
    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
    pub fn retention_period(&self) -> ::std::option::Option<&crate::types::RetentionPeriod> {
        self.retention_period.as_ref()
    }
    /// <p>Information about the resource tags used to identify resources that are retained by the retention rule.</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 `.resource_tags.is_none()`.
    pub fn resource_tags(&self) -> &[crate::types::ResourceTag] {
        self.resource_tags.as_deref().unwrap_or_default()
    }
    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::RuleStatus> {
        self.status.as_ref()
    }
    /// <p>Information about the retention rule lock configuration.</p>
    pub fn lock_configuration(&self) -> ::std::option::Option<&crate::types::LockConfiguration> {
        self.lock_configuration.as_ref()
    }
    /// <p>The lock state for the retention rule.</p>
    /// <ul>
    /// <li>
    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
    /// <li>
    /// <p><code>pending_unlock</code> - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.</p></li>
    /// <li>
    /// <p><code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p></li>
    /// <li>
    /// <p><code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p></li>
    /// </ul>
    pub fn lock_state(&self) -> ::std::option::Option<&crate::types::LockState> {
        self.lock_state.as_ref()
    }
    /// <p>The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.</p>
    pub fn lock_end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.lock_end_time.as_ref()
    }
    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
    pub fn rule_arn(&self) -> ::std::option::Option<&str> {
        self.rule_arn.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetRuleOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetRuleOutput {
    /// Creates a new builder-style object to manufacture [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
    pub fn builder() -> crate::operation::get_rule::builders::GetRuleOutputBuilder {
        crate::operation::get_rule::builders::GetRuleOutputBuilder::default()
    }
}

/// A builder for [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRuleOutputBuilder {
    pub(crate) identifier: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
    pub(crate) retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
    pub(crate) status: ::std::option::Option<crate::types::RuleStatus>,
    pub(crate) lock_configuration: ::std::option::Option<crate::types::LockConfiguration>,
    pub(crate) lock_state: ::std::option::Option<crate::types::LockState>,
    pub(crate) lock_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetRuleOutputBuilder {
    /// <p>The unique ID of the retention rule.</p>
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID of the retention rule.</p>
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identifier = input;
        self
    }
    /// <p>The unique ID of the retention rule.</p>
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// <p>The retention rule description.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The retention rule description.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The retention rule description.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The resource type retained by the retention rule.</p>
    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
        self.resource_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The resource type retained by the retention rule.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The resource type retained by the retention rule.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
        &self.resource_type
    }
    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
    pub fn retention_period(mut self, input: crate::types::RetentionPeriod) -> Self {
        self.retention_period = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
    pub fn set_retention_period(mut self, input: ::std::option::Option<crate::types::RetentionPeriod>) -> Self {
        self.retention_period = input;
        self
    }
    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
    pub fn get_retention_period(&self) -> &::std::option::Option<crate::types::RetentionPeriod> {
        &self.retention_period
    }
    /// Appends an item to `resource_tags`.
    ///
    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
    ///
    /// <p>Information about the resource tags used to identify resources that are retained by the retention rule.</p>
    pub fn resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
        let mut v = self.resource_tags.unwrap_or_default();
        v.push(input);
        self.resource_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Information about the resource tags used to identify resources that are retained by the retention rule.</p>
    pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
        self.resource_tags = input;
        self
    }
    /// <p>Information about the resource tags used to identify resources that are retained by the retention rule.</p>
    pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
        &self.resource_tags
    }
    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
    pub fn status(mut self, input: crate::types::RuleStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RuleStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::RuleStatus> {
        &self.status
    }
    /// <p>Information about the retention rule lock configuration.</p>
    pub fn lock_configuration(mut self, input: crate::types::LockConfiguration) -> Self {
        self.lock_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the retention rule lock configuration.</p>
    pub fn set_lock_configuration(mut self, input: ::std::option::Option<crate::types::LockConfiguration>) -> Self {
        self.lock_configuration = input;
        self
    }
    /// <p>Information about the retention rule lock configuration.</p>
    pub fn get_lock_configuration(&self) -> &::std::option::Option<crate::types::LockConfiguration> {
        &self.lock_configuration
    }
    /// <p>The lock state for the retention rule.</p>
    /// <ul>
    /// <li>
    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
    /// <li>
    /// <p><code>pending_unlock</code> - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.</p></li>
    /// <li>
    /// <p><code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p></li>
    /// <li>
    /// <p><code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p></li>
    /// </ul>
    pub fn lock_state(mut self, input: crate::types::LockState) -> Self {
        self.lock_state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The lock state for the retention rule.</p>
    /// <ul>
    /// <li>
    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
    /// <li>
    /// <p><code>pending_unlock</code> - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.</p></li>
    /// <li>
    /// <p><code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p></li>
    /// <li>
    /// <p><code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p></li>
    /// </ul>
    pub fn set_lock_state(mut self, input: ::std::option::Option<crate::types::LockState>) -> Self {
        self.lock_state = input;
        self
    }
    /// <p>The lock state for the retention rule.</p>
    /// <ul>
    /// <li>
    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
    /// <li>
    /// <p><code>pending_unlock</code> - The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired.</p></li>
    /// <li>
    /// <p><code>unlocked</code> - The retention rule is unlocked and it can be modified or deleted by any user with the required permissions.</p></li>
    /// <li>
    /// <p><code>null</code> - The retention rule has never been locked. Once a retention rule has been locked, it can transition between the <code>locked</code> and <code>unlocked</code> states only; it can never transition back to <code>null</code>.</p></li>
    /// </ul>
    pub fn get_lock_state(&self) -> &::std::option::Option<crate::types::LockState> {
        &self.lock_state
    }
    /// <p>The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.</p>
    pub fn lock_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.lock_end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.</p>
    pub fn set_lock_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.lock_end_time = input;
        self
    }
    /// <p>The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.</p>
    pub fn get_lock_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.lock_end_time
    }
    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
    pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.rule_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
    pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.rule_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
    pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.rule_arn
    }
    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 [`GetRuleOutput`](crate::operation::get_rule::GetRuleOutput).
    pub fn build(self) -> crate::operation::get_rule::GetRuleOutput {
        crate::operation::get_rule::GetRuleOutput {
            identifier: self.identifier,
            description: self.description,
            resource_type: self.resource_type,
            retention_period: self.retention_period,
            resource_tags: self.resource_tags,
            status: self.status,
            lock_configuration: self.lock_configuration,
            lock_state: self.lock_state,
            lock_end_time: self.lock_end_time,
            rule_arn: self.rule_arn,
            _request_id: self._request_id,
        }
    }
}