aws_sdk_ebs/operation/start_snapshot/
_start_snapshot_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct StartSnapshotOutput {
6 pub description: ::std::option::Option<::std::string::String>,
8 pub snapshot_id: ::std::option::Option<::std::string::String>,
10 pub owner_id: ::std::option::Option<::std::string::String>,
12 pub status: ::std::option::Option<crate::types::Status>,
14 pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
16 pub volume_size: ::std::option::Option<i64>,
18 pub block_size: ::std::option::Option<i32>,
20 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
22 pub parent_snapshot_id: ::std::option::Option<::std::string::String>,
24 pub kms_key_arn: ::std::option::Option<::std::string::String>,
26 pub sse_type: ::std::option::Option<crate::types::SseType>,
28 _request_id: Option<String>,
29}
30impl StartSnapshotOutput {
31 pub fn description(&self) -> ::std::option::Option<&str> {
33 self.description.as_deref()
34 }
35 pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
37 self.snapshot_id.as_deref()
38 }
39 pub fn owner_id(&self) -> ::std::option::Option<&str> {
41 self.owner_id.as_deref()
42 }
43 pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
45 self.status.as_ref()
46 }
47 pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
49 self.start_time.as_ref()
50 }
51 pub fn volume_size(&self) -> ::std::option::Option<i64> {
53 self.volume_size
54 }
55 pub fn block_size(&self) -> ::std::option::Option<i32> {
57 self.block_size
58 }
59 pub fn tags(&self) -> &[crate::types::Tag] {
63 self.tags.as_deref().unwrap_or_default()
64 }
65 pub fn parent_snapshot_id(&self) -> ::std::option::Option<&str> {
67 self.parent_snapshot_id.as_deref()
68 }
69 pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
71 self.kms_key_arn.as_deref()
72 }
73 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 pub fn builder() -> crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder {
104 crate::operation::start_snapshot::builders::StartSnapshotOutputBuilder::default()
105 }
106}
107
108#[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 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.description = input;
134 self
135 }
136 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
138 &self.description
139 }
140 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 pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.snapshot_id = input;
148 self
149 }
150 pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
152 &self.snapshot_id
153 }
154 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 pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161 self.owner_id = input;
162 self
163 }
164 pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
166 &self.owner_id
167 }
168 pub fn status(mut self, input: crate::types::Status) -> Self {
170 self.status = ::std::option::Option::Some(input);
171 self
172 }
173 pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
175 self.status = input;
176 self
177 }
178 pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
180 &self.status
181 }
182 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 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 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
194 &self.start_time
195 }
196 pub fn volume_size(mut self, input: i64) -> Self {
198 self.volume_size = ::std::option::Option::Some(input);
199 self
200 }
201 pub fn set_volume_size(mut self, input: ::std::option::Option<i64>) -> Self {
203 self.volume_size = input;
204 self
205 }
206 pub fn get_volume_size(&self) -> &::std::option::Option<i64> {
208 &self.volume_size
209 }
210 pub fn block_size(mut self, input: i32) -> Self {
212 self.block_size = ::std::option::Option::Some(input);
213 self
214 }
215 pub fn set_block_size(mut self, input: ::std::option::Option<i32>) -> Self {
217 self.block_size = input;
218 self
219 }
220 pub fn get_block_size(&self) -> &::std::option::Option<i32> {
222 &self.block_size
223 }
224 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
242 &self.tags
243 }
244 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 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 pub fn get_parent_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
256 &self.parent_snapshot_id
257 }
258 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 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 pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
270 &self.kms_key_arn
271 }
272 pub fn sse_type(mut self, input: crate::types::SseType) -> Self {
274 self.sse_type = ::std::option::Option::Some(input);
275 self
276 }
277 pub fn set_sse_type(mut self, input: ::std::option::Option<crate::types::SseType>) -> Self {
279 self.sse_type = input;
280 self
281 }
282 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 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}