aws_sdk_rbin/operation/update_rule/
_update_rule_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateRuleOutput {
6    /// <p>The unique ID of the retention rule.</p>
7    pub identifier: ::std::option::Option<::std::string::String>,
8    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
9    pub retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
10    /// <p>The retention rule description.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The resource type retained by the retention rule.</p>
13    pub resource_type: ::std::option::Option<crate::types::ResourceType>,
14    /// <p>\[Tag-level retention rules only\] Information about the resource tags used to identify resources that are retained by the retention rule.</p>
15    pub resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
16    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
17    pub status: ::std::option::Option<crate::types::RuleStatus>,
18    /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
19    /// <ul>
20    /// <li>
21    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
22    /// <li>
23    /// <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>
24    /// <li>
25    /// <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>
26    /// <li>
27    /// <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>
28    /// </ul>
29    pub lock_state: ::std::option::Option<crate::types::LockState>,
30    /// <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>
31    pub lock_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
32    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
33    pub rule_arn: ::std::option::Option<::std::string::String>,
34    /// <p>\[Region-level retention rules only\] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.</p>
35    pub exclude_resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
36    _request_id: Option<String>,
37}
38impl UpdateRuleOutput {
39    /// <p>The unique ID of the retention rule.</p>
40    pub fn identifier(&self) -> ::std::option::Option<&str> {
41        self.identifier.as_deref()
42    }
43    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
44    pub fn retention_period(&self) -> ::std::option::Option<&crate::types::RetentionPeriod> {
45        self.retention_period.as_ref()
46    }
47    /// <p>The retention rule description.</p>
48    pub fn description(&self) -> ::std::option::Option<&str> {
49        self.description.as_deref()
50    }
51    /// <p>The resource type retained by the retention rule.</p>
52    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
53        self.resource_type.as_ref()
54    }
55    /// <p>\[Tag-level retention rules only\] Information about the resource tags used to identify resources that are retained by the retention rule.</p>
56    ///
57    /// 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()`.
58    pub fn resource_tags(&self) -> &[crate::types::ResourceTag] {
59        self.resource_tags.as_deref().unwrap_or_default()
60    }
61    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
62    pub fn status(&self) -> ::std::option::Option<&crate::types::RuleStatus> {
63        self.status.as_ref()
64    }
65    /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
66    /// <ul>
67    /// <li>
68    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
69    /// <li>
70    /// <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>
71    /// <li>
72    /// <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>
73    /// <li>
74    /// <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>
75    /// </ul>
76    pub fn lock_state(&self) -> ::std::option::Option<&crate::types::LockState> {
77        self.lock_state.as_ref()
78    }
79    /// <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>
80    pub fn lock_end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
81        self.lock_end_time.as_ref()
82    }
83    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
84    pub fn rule_arn(&self) -> ::std::option::Option<&str> {
85        self.rule_arn.as_deref()
86    }
87    /// <p>\[Region-level retention rules only\] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.</p>
88    ///
89    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.exclude_resource_tags.is_none()`.
90    pub fn exclude_resource_tags(&self) -> &[crate::types::ResourceTag] {
91        self.exclude_resource_tags.as_deref().unwrap_or_default()
92    }
93}
94impl ::aws_types::request_id::RequestId for UpdateRuleOutput {
95    fn request_id(&self) -> Option<&str> {
96        self._request_id.as_deref()
97    }
98}
99impl UpdateRuleOutput {
100    /// Creates a new builder-style object to manufacture [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
101    pub fn builder() -> crate::operation::update_rule::builders::UpdateRuleOutputBuilder {
102        crate::operation::update_rule::builders::UpdateRuleOutputBuilder::default()
103    }
104}
105
106/// A builder for [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
107#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
108#[non_exhaustive]
109pub struct UpdateRuleOutputBuilder {
110    pub(crate) identifier: ::std::option::Option<::std::string::String>,
111    pub(crate) retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
112    pub(crate) description: ::std::option::Option<::std::string::String>,
113    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
114    pub(crate) resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
115    pub(crate) status: ::std::option::Option<crate::types::RuleStatus>,
116    pub(crate) lock_state: ::std::option::Option<crate::types::LockState>,
117    pub(crate) lock_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
118    pub(crate) rule_arn: ::std::option::Option<::std::string::String>,
119    pub(crate) exclude_resource_tags: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>,
120    _request_id: Option<String>,
121}
122impl UpdateRuleOutputBuilder {
123    /// <p>The unique ID of the retention rule.</p>
124    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.identifier = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The unique ID of the retention rule.</p>
129    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.identifier = input;
131        self
132    }
133    /// <p>The unique ID of the retention rule.</p>
134    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
135        &self.identifier
136    }
137    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
138    pub fn retention_period(mut self, input: crate::types::RetentionPeriod) -> Self {
139        self.retention_period = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
143    pub fn set_retention_period(mut self, input: ::std::option::Option<crate::types::RetentionPeriod>) -> Self {
144        self.retention_period = input;
145        self
146    }
147    /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
148    pub fn get_retention_period(&self) -> &::std::option::Option<crate::types::RetentionPeriod> {
149        &self.retention_period
150    }
151    /// <p>The retention rule description.</p>
152    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.description = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The retention rule description.</p>
157    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.description = input;
159        self
160    }
161    /// <p>The retention rule description.</p>
162    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
163        &self.description
164    }
165    /// <p>The resource type retained by the retention rule.</p>
166    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
167        self.resource_type = ::std::option::Option::Some(input);
168        self
169    }
170    /// <p>The resource type retained by the retention rule.</p>
171    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
172        self.resource_type = input;
173        self
174    }
175    /// <p>The resource type retained by the retention rule.</p>
176    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
177        &self.resource_type
178    }
179    /// Appends an item to `resource_tags`.
180    ///
181    /// To override the contents of this collection use [`set_resource_tags`](Self::set_resource_tags).
182    ///
183    /// <p>\[Tag-level retention rules only\] Information about the resource tags used to identify resources that are retained by the retention rule.</p>
184    pub fn resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
185        let mut v = self.resource_tags.unwrap_or_default();
186        v.push(input);
187        self.resource_tags = ::std::option::Option::Some(v);
188        self
189    }
190    /// <p>\[Tag-level retention rules only\] Information about the resource tags used to identify resources that are retained by the retention rule.</p>
191    pub fn set_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
192        self.resource_tags = input;
193        self
194    }
195    /// <p>\[Tag-level retention rules only\] Information about the resource tags used to identify resources that are retained by the retention rule.</p>
196    pub fn get_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
197        &self.resource_tags
198    }
199    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
200    pub fn status(mut self, input: crate::types::RuleStatus) -> Self {
201        self.status = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
205    pub fn set_status(mut self, input: ::std::option::Option<crate::types::RuleStatus>) -> Self {
206        self.status = input;
207        self
208    }
209    /// <p>The state of the retention rule. Only retention rules that are in the <code>available</code> state retain resources.</p>
210    pub fn get_status(&self) -> &::std::option::Option<crate::types::RuleStatus> {
211        &self.status
212    }
213    /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
214    /// <ul>
215    /// <li>
216    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
217    /// <li>
218    /// <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>
219    /// <li>
220    /// <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>
221    /// <li>
222    /// <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>
223    /// </ul>
224    pub fn lock_state(mut self, input: crate::types::LockState) -> Self {
225        self.lock_state = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
229    /// <ul>
230    /// <li>
231    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
232    /// <li>
233    /// <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>
234    /// <li>
235    /// <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>
236    /// <li>
237    /// <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>
238    /// </ul>
239    pub fn set_lock_state(mut self, input: ::std::option::Option<crate::types::LockState>) -> Self {
240        self.lock_state = input;
241        self
242    }
243    /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
244    /// <ul>
245    /// <li>
246    /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
247    /// <li>
248    /// <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>
249    /// <li>
250    /// <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>
251    /// <li>
252    /// <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>
253    /// </ul>
254    pub fn get_lock_state(&self) -> &::std::option::Option<crate::types::LockState> {
255        &self.lock_state
256    }
257    /// <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>
258    pub fn lock_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
259        self.lock_end_time = ::std::option::Option::Some(input);
260        self
261    }
262    /// <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>
263    pub fn set_lock_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
264        self.lock_end_time = input;
265        self
266    }
267    /// <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>
268    pub fn get_lock_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
269        &self.lock_end_time
270    }
271    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
272    pub fn rule_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.rule_arn = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
277    pub fn set_rule_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.rule_arn = input;
279        self
280    }
281    /// <p>The Amazon Resource Name (ARN) of the retention rule.</p>
282    pub fn get_rule_arn(&self) -> &::std::option::Option<::std::string::String> {
283        &self.rule_arn
284    }
285    /// Appends an item to `exclude_resource_tags`.
286    ///
287    /// To override the contents of this collection use [`set_exclude_resource_tags`](Self::set_exclude_resource_tags).
288    ///
289    /// <p>\[Region-level retention rules only\] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.</p>
290    pub fn exclude_resource_tags(mut self, input: crate::types::ResourceTag) -> Self {
291        let mut v = self.exclude_resource_tags.unwrap_or_default();
292        v.push(input);
293        self.exclude_resource_tags = ::std::option::Option::Some(v);
294        self
295    }
296    /// <p>\[Region-level retention rules only\] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.</p>
297    pub fn set_exclude_resource_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>>) -> Self {
298        self.exclude_resource_tags = input;
299        self
300    }
301    /// <p>\[Region-level retention rules only\] Information about the exclusion tags used to identify resources that are to be excluded, or ignored, by the retention rule.</p>
302    pub fn get_exclude_resource_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceTag>> {
303        &self.exclude_resource_tags
304    }
305    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
306        self._request_id = Some(request_id.into());
307        self
308    }
309
310    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
311        self._request_id = request_id;
312        self
313    }
314    /// Consumes the builder and constructs a [`UpdateRuleOutput`](crate::operation::update_rule::UpdateRuleOutput).
315    pub fn build(self) -> crate::operation::update_rule::UpdateRuleOutput {
316        crate::operation::update_rule::UpdateRuleOutput {
317            identifier: self.identifier,
318            retention_period: self.retention_period,
319            description: self.description,
320            resource_type: self.resource_type,
321            resource_tags: self.resource_tags,
322            status: self.status,
323            lock_state: self.lock_state,
324            lock_end_time: self.lock_end_time,
325            rule_arn: self.rule_arn,
326            exclude_resource_tags: self.exclude_resource_tags,
327            _request_id: self._request_id,
328        }
329    }
330}