aws_sdk_ebs/operation/start_snapshot/
_start_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)]
5pub struct StartSnapshotOutput {
6    /// <p>The description of the snapshot.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the snapshot.</p>
9    pub snapshot_id: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Web Services account ID of the snapshot owner.</p>
11    pub owner_id: ::std::option::Option<::std::string::String>,
12    /// <p>The status of the snapshot.</p>
13    pub status: ::std::option::Option<crate::types::Status>,
14    /// <p>The timestamp when the snapshot was created.</p>
15    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
16    /// <p>The size of the volume, in GiB.</p>
17    pub volume_size: ::std::option::Option<i64>,
18    /// <p>The size of the blocks in the snapshot, in bytes.</p>
19    pub block_size: ::std::option::Option<i32>,
20    /// <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html"> Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
21    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
22    /// <p>The ID of the parent snapshot.</p>
23    pub parent_snapshot_id: ::std::option::Option<::std::string::String>,
24    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.</p>
25    pub kms_key_arn: ::std::option::Option<::std::string::String>,
26    /// <p>Reserved for future use.</p>
27    pub sse_type: ::std::option::Option<crate::types::SseType>,
28    _request_id: Option<String>,
29}
30impl StartSnapshotOutput {
31    /// <p>The description of the snapshot.</p>
32    pub fn description(&self) -> ::std::option::Option<&str> {
33        self.description.as_deref()
34    }
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 Amazon Web Services account ID of the snapshot owner.</p>
40    pub fn owner_id(&self) -> ::std::option::Option<&str> {
41        self.owner_id.as_deref()
42    }
43    /// <p>The status of the snapshot.</p>
44    pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
45        self.status.as_ref()
46    }
47    /// <p>The timestamp when the snapshot was created.</p>
48    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49        self.start_time.as_ref()
50    }
51    /// <p>The size of the volume, in GiB.</p>
52    pub fn volume_size(&self) -> ::std::option::Option<i64> {
53        self.volume_size
54    }
55    /// <p>The size of the blocks in the snapshot, in bytes.</p>
56    pub fn block_size(&self) -> ::std::option::Option<i32> {
57        self.block_size
58    }
59    /// <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html"> Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
60    ///
61    /// 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()`.
62    pub fn tags(&self) -> &[crate::types::Tag] {
63        self.tags.as_deref().unwrap_or_default()
64    }
65    /// <p>The ID of the parent snapshot.</p>
66    pub fn parent_snapshot_id(&self) -> ::std::option::Option<&str> {
67        self.parent_snapshot_id.as_deref()
68    }
69    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.</p>
70    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
71        self.kms_key_arn.as_deref()
72    }
73    /// <p>Reserved for future use.</p>
74    pub fn sse_type(&self) -> ::std::option::Option<&crate::types::SseType> {
75        self.sse_type.as_ref()
76    }
77}
78impl ::std::fmt::Debug for StartSnapshotOutput {
79    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
80        let mut formatter = f.debug_struct("StartSnapshotOutput");
81        formatter.field("description", &self.description);
82        formatter.field("snapshot_id", &self.snapshot_id);
83        formatter.field("owner_id", &self.owner_id);
84        formatter.field("status", &self.status);
85        formatter.field("start_time", &self.start_time);
86        formatter.field("volume_size", &self.volume_size);
87        formatter.field("block_size", &self.block_size);
88        formatter.field("tags", &self.tags);
89        formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
90        formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
91        formatter.field("sse_type", &self.sse_type);
92        formatter.field("_request_id", &self._request_id);
93        formatter.finish()
94    }
95}
96impl ::aws_types::request_id::RequestId for StartSnapshotOutput {
97    fn request_id(&self) -> Option<&str> {
98        self._request_id.as_deref()
99    }
100}
101impl StartSnapshotOutput {
102    /// Creates a new builder-style object to manufacture [`StartSnapshotOutput`](crate::operation::start_snapshot::StartSnapshotOutput).
103    pub fn builder() -> crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder {
104        crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder::default()
105    }
106}
107
108/// A builder for [`StartSnapshotOutput`](crate::operation::start_snapshot::StartSnapshotOutput).
109#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
110#[non_exhaustive]
111pub struct StartSnapshotOutputBuilder {
112    pub(crate) description: ::std::option::Option<::std::string::String>,
113    pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
114    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
115    pub(crate) status: ::std::option::Option<crate::types::Status>,
116    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
117    pub(crate) volume_size: ::std::option::Option<i64>,
118    pub(crate) block_size: ::std::option::Option<i32>,
119    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
120    pub(crate) parent_snapshot_id: ::std::option::Option<::std::string::String>,
121    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
122    pub(crate) sse_type: ::std::option::Option<crate::types::SseType>,
123    _request_id: Option<String>,
124}
125impl StartSnapshotOutputBuilder {
126    /// <p>The description of the snapshot.</p>
127    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.description = ::std::option::Option::Some(input.into());
129        self
130    }
131    /// <p>The description of the snapshot.</p>
132    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.description = input;
134        self
135    }
136    /// <p>The description of the snapshot.</p>
137    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
138        &self.description
139    }
140    /// <p>The ID of the snapshot.</p>
141    pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.snapshot_id = ::std::option::Option::Some(input.into());
143        self
144    }
145    /// <p>The ID of the snapshot.</p>
146    pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.snapshot_id = input;
148        self
149    }
150    /// <p>The ID of the snapshot.</p>
151    pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
152        &self.snapshot_id
153    }
154    /// <p>The Amazon Web Services account ID of the snapshot owner.</p>
155    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156        self.owner_id = ::std::option::Option::Some(input.into());
157        self
158    }
159    /// <p>The Amazon Web Services account ID of the snapshot owner.</p>
160    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.owner_id = input;
162        self
163    }
164    /// <p>The Amazon Web Services account ID of the snapshot owner.</p>
165    pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
166        &self.owner_id
167    }
168    /// <p>The status of the snapshot.</p>
169    pub fn status(mut self, input: crate::types::Status) -> Self {
170        self.status = ::std::option::Option::Some(input);
171        self
172    }
173    /// <p>The status of the snapshot.</p>
174    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
175        self.status = input;
176        self
177    }
178    /// <p>The status of the snapshot.</p>
179    pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
180        &self.status
181    }
182    /// <p>The timestamp when the snapshot was created.</p>
183    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
184        self.start_time = ::std::option::Option::Some(input);
185        self
186    }
187    /// <p>The timestamp when the snapshot was created.</p>
188    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
189        self.start_time = input;
190        self
191    }
192    /// <p>The timestamp when the snapshot was created.</p>
193    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
194        &self.start_time
195    }
196    /// <p>The size of the volume, in GiB.</p>
197    pub fn volume_size(mut self, input: i64) -> Self {
198        self.volume_size = ::std::option::Option::Some(input);
199        self
200    }
201    /// <p>The size of the volume, in GiB.</p>
202    pub fn set_volume_size(mut self, input: ::std::option::Option<i64>) -> Self {
203        self.volume_size = input;
204        self
205    }
206    /// <p>The size of the volume, in GiB.</p>
207    pub fn get_volume_size(&self) -> &::std::option::Option<i64> {
208        &self.volume_size
209    }
210    /// <p>The size of the blocks in the snapshot, in bytes.</p>
211    pub fn block_size(mut self, input: i32) -> Self {
212        self.block_size = ::std::option::Option::Some(input);
213        self
214    }
215    /// <p>The size of the blocks in the snapshot, in bytes.</p>
216    pub fn set_block_size(mut self, input: ::std::option::Option<i32>) -> Self {
217        self.block_size = input;
218        self
219    }
220    /// <p>The size of the blocks in the snapshot, in bytes.</p>
221    pub fn get_block_size(&self) -> &::std::option::Option<i32> {
222        &self.block_size
223    }
224    /// Appends an item to `tags`.
225    ///
226    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
227    ///
228    /// <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html"> Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
229    pub fn tags(mut self, input: crate::types::Tag) -> Self {
230        let mut v = self.tags.unwrap_or_default();
231        v.push(input);
232        self.tags = ::std::option::Option::Some(v);
233        self
234    }
235    /// <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html"> Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
236    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
237        self.tags = input;
238        self
239    }
240    /// <p>The tags applied to the snapshot. You can specify up to 50 tags per snapshot. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html"> Tagging your Amazon EC2 resources</a> in the <i>Amazon Elastic Compute Cloud User Guide</i>.</p>
241    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
242        &self.tags
243    }
244    /// <p>The ID of the parent snapshot.</p>
245    pub fn parent_snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246        self.parent_snapshot_id = ::std::option::Option::Some(input.into());
247        self
248    }
249    /// <p>The ID of the parent snapshot.</p>
250    pub fn set_parent_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
251        self.parent_snapshot_id = input;
252        self
253    }
254    /// <p>The ID of the parent snapshot.</p>
255    pub fn get_parent_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
256        &self.parent_snapshot_id
257    }
258    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.</p>
259    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
260        self.kms_key_arn = ::std::option::Option::Some(input.into());
261        self
262    }
263    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.</p>
264    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
265        self.kms_key_arn = input;
266        self
267    }
268    /// <p>The Amazon Resource Name (ARN) of the Key Management Service (KMS) key used to encrypt the snapshot.</p>
269    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
270        &self.kms_key_arn
271    }
272    /// <p>Reserved for future use.</p>
273    pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
274        self.sse_type = ::std::option::Option::Some(input);
275        self
276    }
277    /// <p>Reserved for future use.</p>
278    pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
279        self.sse_type = input;
280        self
281    }
282    /// <p>Reserved for future use.</p>
283    pub fn get_sse_type(&self) -> &::std::option::Option<crate::types::SseType> {
284        &self.sse_type
285    }
286    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
287        self._request_id = Some(request_id.into());
288        self
289    }
290
291    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
292        self._request_id = request_id;
293        self
294    }
295    /// Consumes the builder and constructs a [`StartSnapshotOutput`](crate::operation::start_snapshot::StartSnapshotOutput).
296    pub fn build(self) -> crate::operation::start_snapshot::StartSnapshotOutput {
297        crate::operation::start_snapshot::StartSnapshotOutput {
298            description: self.description,
299            snapshot_id: self.snapshot_id,
300            owner_id: self.owner_id,
301            status: self.status,
302            start_time: self.start_time,
303            volume_size: self.volume_size,
304            block_size: self.block_size,
305            tags: self.tags,
306            parent_snapshot_id: self.parent_snapshot_id,
307            kms_key_arn: self.kms_key_arn,
308            sse_type: self.sse_type,
309            _request_id: self._request_id,
310        }
311    }
312}
313impl ::std::fmt::Debug for StartSnapshotOutputBuilder {
314    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
315        let mut formatter = f.debug_struct("StartSnapshotOutputBuilder");
316        formatter.field("description", &self.description);
317        formatter.field("snapshot_id", &self.snapshot_id);
318        formatter.field("owner_id", &self.owner_id);
319        formatter.field("status", &self.status);
320        formatter.field("start_time", &self.start_time);
321        formatter.field("volume_size", &self.volume_size);
322        formatter.field("block_size", &self.block_size);
323        formatter.field("tags", &self.tags);
324        formatter.field("parent_snapshot_id", &self.parent_snapshot_id);
325        formatter.field("kms_key_arn", &"*** Sensitive Data Redacted ***");
326        formatter.field("sse_type", &self.sse_type);
327        formatter.field("_request_id", &self._request_id);
328        formatter.finish()
329    }
330}