1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p><b>\[Default policies only\]</b> Specifies exclusion parameters for volumes or instances for which you do not want to create snapshots or AMIs. The policy will not create snapshots or AMIs for target resources that match any of the specified exclusion parameters.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Exclusions {
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify <code>true</code>.</p>
    pub exclude_boot_volumes: ::std::option::Option<bool>,
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.</p>
    pub exclude_volume_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p><b>\[Default policies for EBS-backed AMIs only\]</b> Specifies whether to exclude volumes that have specific tags.</p>
    pub exclude_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl Exclusions {
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify <code>true</code>.</p>
    pub fn exclude_boot_volumes(&self) -> ::std::option::Option<bool> {
        self.exclude_boot_volumes
    }
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.exclude_volume_types.is_none()`.
    pub fn exclude_volume_types(&self) -> &[::std::string::String] {
        self.exclude_volume_types.as_deref().unwrap_or_default()
    }
    /// <p><b>\[Default policies for EBS-backed AMIs only\]</b> Specifies whether to exclude volumes that have specific tags.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.exclude_tags.is_none()`.
    pub fn exclude_tags(&self) -> &[crate::types::Tag] {
        self.exclude_tags.as_deref().unwrap_or_default()
    }
}
impl Exclusions {
    /// Creates a new builder-style object to manufacture [`Exclusions`](crate::types::Exclusions).
    pub fn builder() -> crate::types::builders::ExclusionsBuilder {
        crate::types::builders::ExclusionsBuilder::default()
    }
}

/// A builder for [`Exclusions`](crate::types::Exclusions).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExclusionsBuilder {
    pub(crate) exclude_boot_volumes: ::std::option::Option<bool>,
    pub(crate) exclude_volume_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) exclude_tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl ExclusionsBuilder {
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify <code>true</code>.</p>
    pub fn exclude_boot_volumes(mut self, input: bool) -> Self {
        self.exclude_boot_volumes = ::std::option::Option::Some(input);
        self
    }
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify <code>true</code>.</p>
    pub fn set_exclude_boot_volumes(mut self, input: ::std::option::Option<bool>) -> Self {
        self.exclude_boot_volumes = input;
        self
    }
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Indicates whether to exclude volumes that are attached to instances as the boot volume. If you exclude boot volumes, only volumes attached as data (non-boot) volumes will be backed up by the policy. To exclude boot volumes, specify <code>true</code>.</p>
    pub fn get_exclude_boot_volumes(&self) -> &::std::option::Option<bool> {
        &self.exclude_boot_volumes
    }
    /// Appends an item to `exclude_volume_types`.
    ///
    /// To override the contents of this collection use [`set_exclude_volume_types`](Self::set_exclude_volume_types).
    ///
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.</p>
    pub fn exclude_volume_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.exclude_volume_types.unwrap_or_default();
        v.push(input.into());
        self.exclude_volume_types = ::std::option::Option::Some(v);
        self
    }
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.</p>
    pub fn set_exclude_volume_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.exclude_volume_types = input;
        self
    }
    /// <p><b>\[Default policies for EBS snapshots only\]</b> Specifies the volume types to exclude. Volumes of the specified types will not be targeted by the policy.</p>
    pub fn get_exclude_volume_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.exclude_volume_types
    }
    /// Appends an item to `exclude_tags`.
    ///
    /// To override the contents of this collection use [`set_exclude_tags`](Self::set_exclude_tags).
    ///
    /// <p><b>\[Default policies for EBS-backed AMIs only\]</b> Specifies whether to exclude volumes that have specific tags.</p>
    pub fn exclude_tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.exclude_tags.unwrap_or_default();
        v.push(input);
        self.exclude_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p><b>\[Default policies for EBS-backed AMIs only\]</b> Specifies whether to exclude volumes that have specific tags.</p>
    pub fn set_exclude_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.exclude_tags = input;
        self
    }
    /// <p><b>\[Default policies for EBS-backed AMIs only\]</b> Specifies whether to exclude volumes that have specific tags.</p>
    pub fn get_exclude_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.exclude_tags
    }
    /// Consumes the builder and constructs a [`Exclusions`](crate::types::Exclusions).
    pub fn build(self) -> crate::types::Exclusions {
        crate::types::Exclusions {
            exclude_boot_volumes: self.exclude_boot_volumes,
            exclude_volume_types: self.exclude_volume_types,
            exclude_tags: self.exclude_tags,
        }
    }
}