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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>[Service-managed permissions] The Organizations accounts to which StackSets deploys. StackSets doesn't deploy stack instances to the organization management account, even if the organization management account is in your organization or in an OU in your organization.</p>
/// <p>For update operations, you can specify either <code>Accounts</code> or <code>OrganizationalUnitIds</code>. For create and delete operations, specify <code>OrganizationalUnitIds</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeploymentTargets {
    /// <p>The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.</p>
    pub accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Returns the value of the <code>AccountsUrl</code> property.</p>
    pub accounts_url: ::std::option::Option<::std::string::String>,
    /// <p>The organization root ID or organizational unit (OU) IDs to which StackSets deploys.</p>
    pub organizational_unit_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Limit deployment targets to individual accounts or include additional accounts with provided OUs.</p>
    /// <p>The following is a list of possible values for the <code>AccountFilterType</code> operation.</p>
    /// <ul>
    /// <li>
    /// <p><code>INTERSECTION</code>: StackSets deploys to the accounts specified in <code>Accounts</code> parameter.</p></li>
    /// <li>
    /// <p><code>DIFFERENCE</code>: StackSets excludes the accounts specified in <code>Accounts</code> parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.</p></li>
    /// <li>
    /// <p><code>UNION</code>: StackSets includes additional accounts deployment targets.</p>
    /// <p>This is the default value if <code>AccountFilterType</code> is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests.</p></li>
    /// <li>
    /// <p><code>NONE</code>: Deploys to all the accounts in specified organizational units (OU).</p></li>
    /// </ul>
    pub account_filter_type: ::std::option::Option<crate::types::AccountFilterType>,
}
impl DeploymentTargets {
    /// <p>The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.</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 `.accounts.is_none()`.
    pub fn accounts(&self) -> &[::std::string::String] {
        self.accounts.as_deref().unwrap_or_default()
    }
    /// <p>Returns the value of the <code>AccountsUrl</code> property.</p>
    pub fn accounts_url(&self) -> ::std::option::Option<&str> {
        self.accounts_url.as_deref()
    }
    /// <p>The organization root ID or organizational unit (OU) IDs to which StackSets deploys.</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 `.organizational_unit_ids.is_none()`.
    pub fn organizational_unit_ids(&self) -> &[::std::string::String] {
        self.organizational_unit_ids.as_deref().unwrap_or_default()
    }
    /// <p>Limit deployment targets to individual accounts or include additional accounts with provided OUs.</p>
    /// <p>The following is a list of possible values for the <code>AccountFilterType</code> operation.</p>
    /// <ul>
    /// <li>
    /// <p><code>INTERSECTION</code>: StackSets deploys to the accounts specified in <code>Accounts</code> parameter.</p></li>
    /// <li>
    /// <p><code>DIFFERENCE</code>: StackSets excludes the accounts specified in <code>Accounts</code> parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.</p></li>
    /// <li>
    /// <p><code>UNION</code>: StackSets includes additional accounts deployment targets.</p>
    /// <p>This is the default value if <code>AccountFilterType</code> is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests.</p></li>
    /// <li>
    /// <p><code>NONE</code>: Deploys to all the accounts in specified organizational units (OU).</p></li>
    /// </ul>
    pub fn account_filter_type(&self) -> ::std::option::Option<&crate::types::AccountFilterType> {
        self.account_filter_type.as_ref()
    }
}
impl DeploymentTargets {
    /// Creates a new builder-style object to manufacture [`DeploymentTargets`](crate::types::DeploymentTargets).
    pub fn builder() -> crate::types::builders::DeploymentTargetsBuilder {
        crate::types::builders::DeploymentTargetsBuilder::default()
    }
}

/// A builder for [`DeploymentTargets`](crate::types::DeploymentTargets).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DeploymentTargetsBuilder {
    pub(crate) accounts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) accounts_url: ::std::option::Option<::std::string::String>,
    pub(crate) organizational_unit_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) account_filter_type: ::std::option::Option<crate::types::AccountFilterType>,
}
impl DeploymentTargetsBuilder {
    /// Appends an item to `accounts`.
    ///
    /// To override the contents of this collection use [`set_accounts`](Self::set_accounts).
    ///
    /// <p>The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.</p>
    pub fn accounts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.accounts.unwrap_or_default();
        v.push(input.into());
        self.accounts = ::std::option::Option::Some(v);
        self
    }
    /// <p>The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.</p>
    pub fn set_accounts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.accounts = input;
        self
    }
    /// <p>The names of one or more Amazon Web Services accounts for which you want to deploy stack set updates.</p>
    pub fn get_accounts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.accounts
    }
    /// <p>Returns the value of the <code>AccountsUrl</code> property.</p>
    pub fn accounts_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.accounts_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Returns the value of the <code>AccountsUrl</code> property.</p>
    pub fn set_accounts_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.accounts_url = input;
        self
    }
    /// <p>Returns the value of the <code>AccountsUrl</code> property.</p>
    pub fn get_accounts_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.accounts_url
    }
    /// Appends an item to `organizational_unit_ids`.
    ///
    /// To override the contents of this collection use [`set_organizational_unit_ids`](Self::set_organizational_unit_ids).
    ///
    /// <p>The organization root ID or organizational unit (OU) IDs to which StackSets deploys.</p>
    pub fn organizational_unit_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.organizational_unit_ids.unwrap_or_default();
        v.push(input.into());
        self.organizational_unit_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The organization root ID or organizational unit (OU) IDs to which StackSets deploys.</p>
    pub fn set_organizational_unit_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.organizational_unit_ids = input;
        self
    }
    /// <p>The organization root ID or organizational unit (OU) IDs to which StackSets deploys.</p>
    pub fn get_organizational_unit_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.organizational_unit_ids
    }
    /// <p>Limit deployment targets to individual accounts or include additional accounts with provided OUs.</p>
    /// <p>The following is a list of possible values for the <code>AccountFilterType</code> operation.</p>
    /// <ul>
    /// <li>
    /// <p><code>INTERSECTION</code>: StackSets deploys to the accounts specified in <code>Accounts</code> parameter.</p></li>
    /// <li>
    /// <p><code>DIFFERENCE</code>: StackSets excludes the accounts specified in <code>Accounts</code> parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.</p></li>
    /// <li>
    /// <p><code>UNION</code>: StackSets includes additional accounts deployment targets.</p>
    /// <p>This is the default value if <code>AccountFilterType</code> is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests.</p></li>
    /// <li>
    /// <p><code>NONE</code>: Deploys to all the accounts in specified organizational units (OU).</p></li>
    /// </ul>
    pub fn account_filter_type(mut self, input: crate::types::AccountFilterType) -> Self {
        self.account_filter_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Limit deployment targets to individual accounts or include additional accounts with provided OUs.</p>
    /// <p>The following is a list of possible values for the <code>AccountFilterType</code> operation.</p>
    /// <ul>
    /// <li>
    /// <p><code>INTERSECTION</code>: StackSets deploys to the accounts specified in <code>Accounts</code> parameter.</p></li>
    /// <li>
    /// <p><code>DIFFERENCE</code>: StackSets excludes the accounts specified in <code>Accounts</code> parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.</p></li>
    /// <li>
    /// <p><code>UNION</code>: StackSets includes additional accounts deployment targets.</p>
    /// <p>This is the default value if <code>AccountFilterType</code> is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests.</p></li>
    /// <li>
    /// <p><code>NONE</code>: Deploys to all the accounts in specified organizational units (OU).</p></li>
    /// </ul>
    pub fn set_account_filter_type(mut self, input: ::std::option::Option<crate::types::AccountFilterType>) -> Self {
        self.account_filter_type = input;
        self
    }
    /// <p>Limit deployment targets to individual accounts or include additional accounts with provided OUs.</p>
    /// <p>The following is a list of possible values for the <code>AccountFilterType</code> operation.</p>
    /// <ul>
    /// <li>
    /// <p><code>INTERSECTION</code>: StackSets deploys to the accounts specified in <code>Accounts</code> parameter.</p></li>
    /// <li>
    /// <p><code>DIFFERENCE</code>: StackSets excludes the accounts specified in <code>Accounts</code> parameter. This enables user to avoid certain accounts within an OU such as suspended accounts.</p></li>
    /// <li>
    /// <p><code>UNION</code>: StackSets includes additional accounts deployment targets.</p>
    /// <p>This is the default value if <code>AccountFilterType</code> is not provided. This enables user to update an entire OU and individual accounts from a different OU in one request, which used to be two separate requests.</p></li>
    /// <li>
    /// <p><code>NONE</code>: Deploys to all the accounts in specified organizational units (OU).</p></li>
    /// </ul>
    pub fn get_account_filter_type(&self) -> &::std::option::Option<crate::types::AccountFilterType> {
        &self.account_filter_type
    }
    /// Consumes the builder and constructs a [`DeploymentTargets`](crate::types::DeploymentTargets).
    pub fn build(self) -> crate::types::DeploymentTargets {
        crate::types::DeploymentTargets {
            accounts: self.accounts,
            accounts_url: self.accounts_url,
            organizational_unit_ids: self.organizational_unit_ids,
            account_filter_type: self.account_filter_type,
        }
    }
}