aws_sdk_ec2/operation/lock_snapshot/
_lock_snapshot_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 LockSnapshotOutput {
6    /// <p>The ID of the snapshot</p>
7    pub snapshot_id: ::std::option::Option<::std::string::String>,
8    /// <p>The state of the snapshot lock. Valid states include:</p>
9    /// <ul>
10    /// <li>
11    /// <p><code>compliance-cooloff</code> - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
12    /// <li>
13    /// <p><code>governance</code> - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
14    /// <li>
15    /// <p><code>compliance</code> - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions.</p></li>
16    /// <li>
17    /// <p><code>expired</code> - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.</p></li>
18    /// </ul>
19    pub lock_state: ::std::option::Option<crate::types::LockState>,
20    /// <p>The period of time for which the snapshot is locked, in days.</p>
21    pub lock_duration: ::std::option::Option<i32>,
22    /// <p>The compliance mode cooling-off period, in hours.</p>
23    pub cool_off_period: ::std::option::Option<i32>,
24    /// <p>The date and time at which the compliance mode cooling-off period expires, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
25    pub cool_off_period_expires_on: ::std::option::Option<::aws_smithy_types::DateTime>,
26    /// <p>The date and time at which the snapshot was locked, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
27    pub lock_created_on: ::std::option::Option<::aws_smithy_types::DateTime>,
28    /// <p>The date and time at which the lock will expire, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
29    pub lock_expires_on: ::std::option::Option<::aws_smithy_types::DateTime>,
30    /// <p>The date and time at which the lock duration started, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
31    pub lock_duration_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
32    _request_id: Option<String>,
33}
34impl LockSnapshotOutput {
35    /// <p>The ID of the snapshot</p>
36    pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
37        self.snapshot_id.as_deref()
38    }
39    /// <p>The state of the snapshot lock. Valid states include:</p>
40    /// <ul>
41    /// <li>
42    /// <p><code>compliance-cooloff</code> - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
43    /// <li>
44    /// <p><code>governance</code> - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
45    /// <li>
46    /// <p><code>compliance</code> - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions.</p></li>
47    /// <li>
48    /// <p><code>expired</code> - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.</p></li>
49    /// </ul>
50    pub fn lock_state(&self) -> ::std::option::Option<&crate::types::LockState> {
51        self.lock_state.as_ref()
52    }
53    /// <p>The period of time for which the snapshot is locked, in days.</p>
54    pub fn lock_duration(&self) -> ::std::option::Option<i32> {
55        self.lock_duration
56    }
57    /// <p>The compliance mode cooling-off period, in hours.</p>
58    pub fn cool_off_period(&self) -> ::std::option::Option<i32> {
59        self.cool_off_period
60    }
61    /// <p>The date and time at which the compliance mode cooling-off period expires, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
62    pub fn cool_off_period_expires_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
63        self.cool_off_period_expires_on.as_ref()
64    }
65    /// <p>The date and time at which the snapshot was locked, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
66    pub fn lock_created_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
67        self.lock_created_on.as_ref()
68    }
69    /// <p>The date and time at which the lock will expire, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
70    pub fn lock_expires_on(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
71        self.lock_expires_on.as_ref()
72    }
73    /// <p>The date and time at which the lock duration started, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
74    pub fn lock_duration_start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
75        self.lock_duration_start_time.as_ref()
76    }
77}
78impl ::aws_types::request_id::RequestId for LockSnapshotOutput {
79    fn request_id(&self) -> Option<&str> {
80        self._request_id.as_deref()
81    }
82}
83impl LockSnapshotOutput {
84    /// Creates a new builder-style object to manufacture [`LockSnapshotOutput`](crate::operation::lock_snapshot::LockSnapshotOutput).
85    pub fn builder() -> crate::operation::lock_snapshot::builders::LockSnapshotOutputBuilder {
86        crate::operation::lock_snapshot::builders::LockSnapshotOutputBuilder::default()
87    }
88}
89
90/// A builder for [`LockSnapshotOutput`](crate::operation::lock_snapshot::LockSnapshotOutput).
91#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
92#[non_exhaustive]
93pub struct LockSnapshotOutputBuilder {
94    pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
95    pub(crate) lock_state: ::std::option::Option<crate::types::LockState>,
96    pub(crate) lock_duration: ::std::option::Option<i32>,
97    pub(crate) cool_off_period: ::std::option::Option<i32>,
98    pub(crate) cool_off_period_expires_on: ::std::option::Option<::aws_smithy_types::DateTime>,
99    pub(crate) lock_created_on: ::std::option::Option<::aws_smithy_types::DateTime>,
100    pub(crate) lock_expires_on: ::std::option::Option<::aws_smithy_types::DateTime>,
101    pub(crate) lock_duration_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
102    _request_id: Option<String>,
103}
104impl LockSnapshotOutputBuilder {
105    /// <p>The ID of the snapshot</p>
106    pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.snapshot_id = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// <p>The ID of the snapshot</p>
111    pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.snapshot_id = input;
113        self
114    }
115    /// <p>The ID of the snapshot</p>
116    pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
117        &self.snapshot_id
118    }
119    /// <p>The state of the snapshot lock. Valid states include:</p>
120    /// <ul>
121    /// <li>
122    /// <p><code>compliance-cooloff</code> - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
123    /// <li>
124    /// <p><code>governance</code> - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
125    /// <li>
126    /// <p><code>compliance</code> - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions.</p></li>
127    /// <li>
128    /// <p><code>expired</code> - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.</p></li>
129    /// </ul>
130    pub fn lock_state(mut self, input: crate::types::LockState) -> Self {
131        self.lock_state = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The state of the snapshot lock. Valid states include:</p>
135    /// <ul>
136    /// <li>
137    /// <p><code>compliance-cooloff</code> - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
138    /// <li>
139    /// <p><code>governance</code> - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
140    /// <li>
141    /// <p><code>compliance</code> - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions.</p></li>
142    /// <li>
143    /// <p><code>expired</code> - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.</p></li>
144    /// </ul>
145    pub fn set_lock_state(mut self, input: ::std::option::Option<crate::types::LockState>) -> Self {
146        self.lock_state = input;
147        self
148    }
149    /// <p>The state of the snapshot lock. Valid states include:</p>
150    /// <ul>
151    /// <li>
152    /// <p><code>compliance-cooloff</code> - The snapshot has been locked in compliance mode but it is still within the cooling-off period. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
153    /// <li>
154    /// <p><code>governance</code> - The snapshot is locked in governance mode. The snapshot can't be deleted, but it can be unlocked and the lock settings can be modified by users with appropriate permissions.</p></li>
155    /// <li>
156    /// <p><code>compliance</code> - The snapshot is locked in compliance mode and the cooling-off period has expired. The snapshot can't be unlocked or deleted. The lock duration can only be increased by users with appropriate permissions.</p></li>
157    /// <li>
158    /// <p><code>expired</code> - The snapshot was locked in compliance or governance mode but the lock duration has expired. The snapshot is not locked and can be deleted.</p></li>
159    /// </ul>
160    pub fn get_lock_state(&self) -> &::std::option::Option<crate::types::LockState> {
161        &self.lock_state
162    }
163    /// <p>The period of time for which the snapshot is locked, in days.</p>
164    pub fn lock_duration(mut self, input: i32) -> Self {
165        self.lock_duration = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>The period of time for which the snapshot is locked, in days.</p>
169    pub fn set_lock_duration(mut self, input: ::std::option::Option<i32>) -> Self {
170        self.lock_duration = input;
171        self
172    }
173    /// <p>The period of time for which the snapshot is locked, in days.</p>
174    pub fn get_lock_duration(&self) -> &::std::option::Option<i32> {
175        &self.lock_duration
176    }
177    /// <p>The compliance mode cooling-off period, in hours.</p>
178    pub fn cool_off_period(mut self, input: i32) -> Self {
179        self.cool_off_period = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The compliance mode cooling-off period, in hours.</p>
183    pub fn set_cool_off_period(mut self, input: ::std::option::Option<i32>) -> Self {
184        self.cool_off_period = input;
185        self
186    }
187    /// <p>The compliance mode cooling-off period, in hours.</p>
188    pub fn get_cool_off_period(&self) -> &::std::option::Option<i32> {
189        &self.cool_off_period
190    }
191    /// <p>The date and time at which the compliance mode cooling-off period expires, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
192    pub fn cool_off_period_expires_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
193        self.cool_off_period_expires_on = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The date and time at which the compliance mode cooling-off period expires, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
197    pub fn set_cool_off_period_expires_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
198        self.cool_off_period_expires_on = input;
199        self
200    }
201    /// <p>The date and time at which the compliance mode cooling-off period expires, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
202    pub fn get_cool_off_period_expires_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
203        &self.cool_off_period_expires_on
204    }
205    /// <p>The date and time at which the snapshot was locked, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
206    pub fn lock_created_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
207        self.lock_created_on = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>The date and time at which the snapshot was locked, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
211    pub fn set_lock_created_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
212        self.lock_created_on = input;
213        self
214    }
215    /// <p>The date and time at which the snapshot was locked, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
216    pub fn get_lock_created_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
217        &self.lock_created_on
218    }
219    /// <p>The date and time at which the lock will expire, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
220    pub fn lock_expires_on(mut self, input: ::aws_smithy_types::DateTime) -> Self {
221        self.lock_expires_on = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The date and time at which the lock will expire, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
225    pub fn set_lock_expires_on(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
226        self.lock_expires_on = input;
227        self
228    }
229    /// <p>The date and time at which the lock will expire, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
230    pub fn get_lock_expires_on(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231        &self.lock_expires_on
232    }
233    /// <p>The date and time at which the lock duration started, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
234    pub fn lock_duration_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
235        self.lock_duration_start_time = ::std::option::Option::Some(input);
236        self
237    }
238    /// <p>The date and time at which the lock duration started, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
239    pub fn set_lock_duration_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
240        self.lock_duration_start_time = input;
241        self
242    }
243    /// <p>The date and time at which the lock duration started, in the UTC time zone (<code>YYYY-MM-DDThh:mm:ss.sssZ</code>).</p>
244    pub fn get_lock_duration_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
245        &self.lock_duration_start_time
246    }
247    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
248        self._request_id = Some(request_id.into());
249        self
250    }
251
252    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
253        self._request_id = request_id;
254        self
255    }
256    /// Consumes the builder and constructs a [`LockSnapshotOutput`](crate::operation::lock_snapshot::LockSnapshotOutput).
257    pub fn build(self) -> crate::operation::lock_snapshot::LockSnapshotOutput {
258        crate::operation::lock_snapshot::LockSnapshotOutput {
259            snapshot_id: self.snapshot_id,
260            lock_state: self.lock_state,
261            lock_duration: self.lock_duration,
262            cool_off_period: self.cool_off_period,
263            cool_off_period_expires_on: self.cool_off_period_expires_on,
264            lock_created_on: self.lock_created_on,
265            lock_expires_on: self.lock_expires_on,
266            lock_duration_start_time: self.lock_duration_start_time,
267            _request_id: self._request_id,
268        }
269    }
270}