Skip to main content

aws_sdk_ec2/types/
_disable_fast_snapshot_restore_error_item.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains information about the errors that occurred when disabling fast snapshot restores.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DisableFastSnapshotRestoreErrorItem {
7    /// <p>The ID of the snapshot.</p>
8    pub snapshot_id: ::std::option::Option<::std::string::String>,
9    /// <p>The errors.</p>
10    pub fast_snapshot_restore_state_errors: ::std::option::Option<::std::vec::Vec<crate::types::DisableFastSnapshotRestoreStateErrorItem>>,
11}
12impl DisableFastSnapshotRestoreErrorItem {
13    /// <p>The ID of the snapshot.</p>
14    pub fn snapshot_id(&self) -> ::std::option::Option<&str> {
15        self.snapshot_id.as_deref()
16    }
17    /// <p>The errors.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.fast_snapshot_restore_state_errors.is_none()`.
20    pub fn fast_snapshot_restore_state_errors(&self) -> &[crate::types::DisableFastSnapshotRestoreStateErrorItem] {
21        self.fast_snapshot_restore_state_errors.as_deref().unwrap_or_default()
22    }
23}
24impl DisableFastSnapshotRestoreErrorItem {
25    /// Creates a new builder-style object to manufacture [`DisableFastSnapshotRestoreErrorItem`](crate::types::DisableFastSnapshotRestoreErrorItem).
26    pub fn builder() -> crate::types::builders::DisableFastSnapshotRestoreErrorItemBuilder {
27        crate::types::builders::DisableFastSnapshotRestoreErrorItemBuilder::default()
28    }
29}
30
31/// A builder for [`DisableFastSnapshotRestoreErrorItem`](crate::types::DisableFastSnapshotRestoreErrorItem).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct DisableFastSnapshotRestoreErrorItemBuilder {
35    pub(crate) snapshot_id: ::std::option::Option<::std::string::String>,
36    pub(crate) fast_snapshot_restore_state_errors: ::std::option::Option<::std::vec::Vec<crate::types::DisableFastSnapshotRestoreStateErrorItem>>,
37}
38impl DisableFastSnapshotRestoreErrorItemBuilder {
39    /// <p>The ID of the snapshot.</p>
40    pub fn snapshot_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.snapshot_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The ID of the snapshot.</p>
45    pub fn set_snapshot_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.snapshot_id = input;
47        self
48    }
49    /// <p>The ID of the snapshot.</p>
50    pub fn get_snapshot_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.snapshot_id
52    }
53    /// Appends an item to `fast_snapshot_restore_state_errors`.
54    ///
55    /// To override the contents of this collection use [`set_fast_snapshot_restore_state_errors`](Self::set_fast_snapshot_restore_state_errors).
56    ///
57    /// <p>The errors.</p>
58    pub fn fast_snapshot_restore_state_errors(mut self, input: crate::types::DisableFastSnapshotRestoreStateErrorItem) -> Self {
59        let mut v = self.fast_snapshot_restore_state_errors.unwrap_or_default();
60        v.push(input);
61        self.fast_snapshot_restore_state_errors = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The errors.</p>
65    pub fn set_fast_snapshot_restore_state_errors(
66        mut self,
67        input: ::std::option::Option<::std::vec::Vec<crate::types::DisableFastSnapshotRestoreStateErrorItem>>,
68    ) -> Self {
69        self.fast_snapshot_restore_state_errors = input;
70        self
71    }
72    /// <p>The errors.</p>
73    pub fn get_fast_snapshot_restore_state_errors(
74        &self,
75    ) -> &::std::option::Option<::std::vec::Vec<crate::types::DisableFastSnapshotRestoreStateErrorItem>> {
76        &self.fast_snapshot_restore_state_errors
77    }
78    /// Consumes the builder and constructs a [`DisableFastSnapshotRestoreErrorItem`](crate::types::DisableFastSnapshotRestoreErrorItem).
79    pub fn build(self) -> crate::types::DisableFastSnapshotRestoreErrorItem {
80        crate::types::DisableFastSnapshotRestoreErrorItem {
81            snapshot_id: self.snapshot_id,
82            fast_snapshot_restore_state_errors: self.fast_snapshot_restore_state_errors,
83        }
84    }
85}