aws_sdk_rbin/operation/lock_rule/_lock_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 LockRuleOutput {
6 /// <p>The unique ID of the retention rule.</p>
7 pub identifier: ::std::option::Option<::std::string::String>,
8 /// <p>The retention rule description.</p>
9 pub description: ::std::option::Option<::std::string::String>,
10 /// <p>The resource type retained by the retention rule.</p>
11 pub resource_type: ::std::option::Option<crate::types::ResourceType>,
12 /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
13 pub retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
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>Information about the retention rule lock configuration.</p>
19 pub lock_configuration: ::std::option::Option<crate::types::LockConfiguration>,
20 /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
21 /// <ul>
22 /// <li>
23 /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
24 /// <li>
25 /// <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>
26 /// <li>
27 /// <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>
28 /// <li>
29 /// <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>
30 /// </ul>
31 pub lock_state: ::std::option::Option<crate::types::LockState>,
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 LockRuleOutput {
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>The retention rule description.</p>
44 pub fn description(&self) -> ::std::option::Option<&str> {
45 self.description.as_deref()
46 }
47 /// <p>The resource type retained by the retention rule.</p>
48 pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
49 self.resource_type.as_ref()
50 }
51 /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
52 pub fn retention_period(&self) -> ::std::option::Option<&crate::types::RetentionPeriod> {
53 self.retention_period.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>Information about the retention rule lock configuration.</p>
66 pub fn lock_configuration(&self) -> ::std::option::Option<&crate::types::LockConfiguration> {
67 self.lock_configuration.as_ref()
68 }
69 /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
70 /// <ul>
71 /// <li>
72 /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
73 /// <li>
74 /// <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>
75 /// <li>
76 /// <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>
77 /// <li>
78 /// <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>
79 /// </ul>
80 pub fn lock_state(&self) -> ::std::option::Option<&crate::types::LockState> {
81 self.lock_state.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 LockRuleOutput {
95 fn request_id(&self) -> Option<&str> {
96 self._request_id.as_deref()
97 }
98}
99impl LockRuleOutput {
100 /// Creates a new builder-style object to manufacture [`LockRuleOutput`](crate::operation::lock_rule::LockRuleOutput).
101 pub fn builder() -> crate::operation::lock_rule::builders::LockRuleOutputBuilder {
102 crate::operation::lock_rule::builders::LockRuleOutputBuilder::default()
103 }
104}
105
106/// A builder for [`LockRuleOutput`](crate::operation::lock_rule::LockRuleOutput).
107#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
108#[non_exhaustive]
109pub struct LockRuleOutputBuilder {
110 pub(crate) identifier: ::std::option::Option<::std::string::String>,
111 pub(crate) description: ::std::option::Option<::std::string::String>,
112 pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
113 pub(crate) retention_period: ::std::option::Option<crate::types::RetentionPeriod>,
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_configuration: ::std::option::Option<crate::types::LockConfiguration>,
117 pub(crate) lock_state: ::std::option::Option<crate::types::LockState>,
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 LockRuleOutputBuilder {
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>The retention rule description.</p>
138 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 self.description = ::std::option::Option::Some(input.into());
140 self
141 }
142 /// <p>The retention rule description.</p>
143 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.description = input;
145 self
146 }
147 /// <p>The retention rule description.</p>
148 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
149 &self.description
150 }
151 /// <p>The resource type retained by the retention rule.</p>
152 pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
153 self.resource_type = ::std::option::Option::Some(input);
154 self
155 }
156 /// <p>The resource type retained by the retention rule.</p>
157 pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
158 self.resource_type = input;
159 self
160 }
161 /// <p>The resource type retained by the retention rule.</p>
162 pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
163 &self.resource_type
164 }
165 /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
166 pub fn retention_period(mut self, input: crate::types::RetentionPeriod) -> Self {
167 self.retention_period = ::std::option::Option::Some(input);
168 self
169 }
170 /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
171 pub fn set_retention_period(mut self, input: ::std::option::Option<crate::types::RetentionPeriod>) -> Self {
172 self.retention_period = input;
173 self
174 }
175 /// <p>Information about the retention period for which the retention rule is to retain resources.</p>
176 pub fn get_retention_period(&self) -> &::std::option::Option<crate::types::RetentionPeriod> {
177 &self.retention_period
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>Information about the retention rule lock configuration.</p>
214 pub fn lock_configuration(mut self, input: crate::types::LockConfiguration) -> Self {
215 self.lock_configuration = ::std::option::Option::Some(input);
216 self
217 }
218 /// <p>Information about the retention rule lock configuration.</p>
219 pub fn set_lock_configuration(mut self, input: ::std::option::Option<crate::types::LockConfiguration>) -> Self {
220 self.lock_configuration = input;
221 self
222 }
223 /// <p>Information about the retention rule lock configuration.</p>
224 pub fn get_lock_configuration(&self) -> &::std::option::Option<crate::types::LockConfiguration> {
225 &self.lock_configuration
226 }
227 /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
228 /// <ul>
229 /// <li>
230 /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
231 /// <li>
232 /// <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>
233 /// <li>
234 /// <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>
235 /// <li>
236 /// <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>
237 /// </ul>
238 pub fn lock_state(mut self, input: crate::types::LockState) -> Self {
239 self.lock_state = ::std::option::Option::Some(input);
240 self
241 }
242 /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
243 /// <ul>
244 /// <li>
245 /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
246 /// <li>
247 /// <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>
248 /// <li>
249 /// <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>
250 /// <li>
251 /// <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>
252 /// </ul>
253 pub fn set_lock_state(mut self, input: ::std::option::Option<crate::types::LockState>) -> Self {
254 self.lock_state = input;
255 self
256 }
257 /// <p>\[Region-level retention rules only\] The lock state for the retention rule.</p>
258 /// <ul>
259 /// <li>
260 /// <p><code>locked</code> - The retention rule is locked and can't be modified or deleted.</p></li>
261 /// <li>
262 /// <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>
263 /// <li>
264 /// <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>
265 /// <li>
266 /// <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>
267 /// </ul>
268 pub fn get_lock_state(&self) -> &::std::option::Option<crate::types::LockState> {
269 &self.lock_state
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 [`LockRuleOutput`](crate::operation::lock_rule::LockRuleOutput).
315 pub fn build(self) -> crate::operation::lock_rule::LockRuleOutput {
316 crate::operation::lock_rule::LockRuleOutput {
317 identifier: self.identifier,
318 description: self.description,
319 resource_type: self.resource_type,
320 retention_period: self.retention_period,
321 resource_tags: self.resource_tags,
322 status: self.status,
323 lock_configuration: self.lock_configuration,
324 lock_state: self.lock_state,
325 rule_arn: self.rule_arn,
326 exclude_resource_tags: self.exclude_resource_tags,
327 _request_id: self._request_id,
328 }
329 }
330}