aws_sdk_ec2/operation/create_snapshots/
_create_snapshots_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateSnapshotsOutput {
6 pub snapshots: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotInfo>>,
8 _request_id: Option<String>,
9}
10impl CreateSnapshotsOutput {
11 pub fn snapshots(&self) -> &[crate::types::SnapshotInfo] {
15 self.snapshots.as_deref().unwrap_or_default()
16 }
17}
18impl ::aws_types::request_id::RequestId for CreateSnapshotsOutput {
19 fn request_id(&self) -> Option<&str> {
20 self._request_id.as_deref()
21 }
22}
23impl CreateSnapshotsOutput {
24 pub fn builder() -> crate::operation::create_snapshots::builders::CreateSnapshotsOutputBuilder {
26 crate::operation::create_snapshots::builders::CreateSnapshotsOutputBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateSnapshotsOutputBuilder {
34 pub(crate) snapshots: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotInfo>>,
35 _request_id: Option<String>,
36}
37impl CreateSnapshotsOutputBuilder {
38 pub fn snapshots(mut self, input: crate::types::SnapshotInfo) -> Self {
44 let mut v = self.snapshots.unwrap_or_default();
45 v.push(input);
46 self.snapshots = ::std::option::Option::Some(v);
47 self
48 }
49 pub fn set_snapshots(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SnapshotInfo>>) -> Self {
51 self.snapshots = input;
52 self
53 }
54 pub fn get_snapshots(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SnapshotInfo>> {
56 &self.snapshots
57 }
58 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
59 self._request_id = Some(request_id.into());
60 self
61 }
62
63 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
64 self._request_id = request_id;
65 self
66 }
67 pub fn build(self) -> crate::operation::create_snapshots::CreateSnapshotsOutput {
69 crate::operation::create_snapshots::CreateSnapshotsOutput {
70 snapshots: self.snapshots,
71 _request_id: self._request_id,
72 }
73 }
74}