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