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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The Amazon Chime account details. An AWS account can have multiple Amazon Chime accounts.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Account {
    /// <p>The AWS account ID.</p>
    pub aws_account_id: ::std::string::String,
    /// <p>The Amazon Chime account ID.</p>
    pub account_id: ::std::string::String,
    /// <p>The Amazon Chime account name.</p>
    pub name: ::std::string::String,
    /// <p>The Amazon Chime account type. For more information about different account types, see <a href="https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>
    pub account_type: ::std::option::Option<crate::types::AccountType>,
    /// <p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>
    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The default license for the Amazon Chime account.</p>
    pub default_license: ::std::option::Option<crate::types::License>,
    /// <p>Supported licenses for the Amazon Chime account.</p>
    pub supported_licenses: ::std::option::Option<::std::vec::Vec<crate::types::License>>,
    /// <p>The status of the account.</p>
    pub account_status: ::std::option::Option<crate::types::AccountStatus>,
    /// <p>The sign-in delegate groups associated with the account.</p>
    pub signin_delegate_groups: ::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>>,
}
impl Account {
    /// <p>The AWS account ID.</p>
    pub fn aws_account_id(&self) -> &str {
        use std::ops::Deref;
        self.aws_account_id.deref()
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn account_id(&self) -> &str {
        use std::ops::Deref;
        self.account_id.deref()
    }
    /// <p>The Amazon Chime account name.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The Amazon Chime account type. For more information about different account types, see <a href="https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>
    pub fn account_type(&self) -> ::std::option::Option<&crate::types::AccountType> {
        self.account_type.as_ref()
    }
    /// <p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>
    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_timestamp.as_ref()
    }
    /// <p>The default license for the Amazon Chime account.</p>
    pub fn default_license(&self) -> ::std::option::Option<&crate::types::License> {
        self.default_license.as_ref()
    }
    /// <p>Supported licenses for the Amazon Chime account.</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 `.supported_licenses.is_none()`.
    pub fn supported_licenses(&self) -> &[crate::types::License] {
        self.supported_licenses.as_deref().unwrap_or_default()
    }
    /// <p>The status of the account.</p>
    pub fn account_status(&self) -> ::std::option::Option<&crate::types::AccountStatus> {
        self.account_status.as_ref()
    }
    /// <p>The sign-in delegate groups associated with the account.</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 `.signin_delegate_groups.is_none()`.
    pub fn signin_delegate_groups(&self) -> &[crate::types::SigninDelegateGroup] {
        self.signin_delegate_groups.as_deref().unwrap_or_default()
    }
}
impl Account {
    /// Creates a new builder-style object to manufacture [`Account`](crate::types::Account).
    pub fn builder() -> crate::types::builders::AccountBuilder {
        crate::types::builders::AccountBuilder::default()
    }
}

/// A builder for [`Account`](crate::types::Account).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AccountBuilder {
    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) account_type: ::std::option::Option<crate::types::AccountType>,
    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) default_license: ::std::option::Option<crate::types::License>,
    pub(crate) supported_licenses: ::std::option::Option<::std::vec::Vec<crate::types::License>>,
    pub(crate) account_status: ::std::option::Option<crate::types::AccountStatus>,
    pub(crate) signin_delegate_groups: ::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>>,
}
impl AccountBuilder {
    /// <p>The AWS account ID.</p>
    /// This field is required.
    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aws_account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The AWS account ID.</p>
    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aws_account_id = input;
        self
    }
    /// <p>The AWS account ID.</p>
    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.aws_account_id
    }
    /// <p>The Amazon Chime account ID.</p>
    /// This field is required.
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// <p>The Amazon Chime account ID.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// <p>The Amazon Chime account name.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Chime account name.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The Amazon Chime account name.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The Amazon Chime account type. For more information about different account types, see <a href="https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>
    pub fn account_type(mut self, input: crate::types::AccountType) -> Self {
        self.account_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon Chime account type. For more information about different account types, see <a href="https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>
    pub fn set_account_type(mut self, input: ::std::option::Option<crate::types::AccountType>) -> Self {
        self.account_type = input;
        self
    }
    /// <p>The Amazon Chime account type. For more information about different account types, see <a href="https://docs.aws.amazon.com/chime/latest/ag/manage-chime-account.html">Managing Your Amazon Chime Accounts</a> in the <i>Amazon Chime Administration Guide</i>.</p>
    pub fn get_account_type(&self) -> &::std::option::Option<crate::types::AccountType> {
        &self.account_type
    }
    /// <p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>
    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>
    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_timestamp = input;
        self
    }
    /// <p>The Amazon Chime account creation timestamp, in ISO 8601 format.</p>
    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_timestamp
    }
    /// <p>The default license for the Amazon Chime account.</p>
    pub fn default_license(mut self, input: crate::types::License) -> Self {
        self.default_license = ::std::option::Option::Some(input);
        self
    }
    /// <p>The default license for the Amazon Chime account.</p>
    pub fn set_default_license(mut self, input: ::std::option::Option<crate::types::License>) -> Self {
        self.default_license = input;
        self
    }
    /// <p>The default license for the Amazon Chime account.</p>
    pub fn get_default_license(&self) -> &::std::option::Option<crate::types::License> {
        &self.default_license
    }
    /// Appends an item to `supported_licenses`.
    ///
    /// To override the contents of this collection use [`set_supported_licenses`](Self::set_supported_licenses).
    ///
    /// <p>Supported licenses for the Amazon Chime account.</p>
    pub fn supported_licenses(mut self, input: crate::types::License) -> Self {
        let mut v = self.supported_licenses.unwrap_or_default();
        v.push(input);
        self.supported_licenses = ::std::option::Option::Some(v);
        self
    }
    /// <p>Supported licenses for the Amazon Chime account.</p>
    pub fn set_supported_licenses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::License>>) -> Self {
        self.supported_licenses = input;
        self
    }
    /// <p>Supported licenses for the Amazon Chime account.</p>
    pub fn get_supported_licenses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::License>> {
        &self.supported_licenses
    }
    /// <p>The status of the account.</p>
    pub fn account_status(mut self, input: crate::types::AccountStatus) -> Self {
        self.account_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the account.</p>
    pub fn set_account_status(mut self, input: ::std::option::Option<crate::types::AccountStatus>) -> Self {
        self.account_status = input;
        self
    }
    /// <p>The status of the account.</p>
    pub fn get_account_status(&self) -> &::std::option::Option<crate::types::AccountStatus> {
        &self.account_status
    }
    /// Appends an item to `signin_delegate_groups`.
    ///
    /// To override the contents of this collection use [`set_signin_delegate_groups`](Self::set_signin_delegate_groups).
    ///
    /// <p>The sign-in delegate groups associated with the account.</p>
    pub fn signin_delegate_groups(mut self, input: crate::types::SigninDelegateGroup) -> Self {
        let mut v = self.signin_delegate_groups.unwrap_or_default();
        v.push(input);
        self.signin_delegate_groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>The sign-in delegate groups associated with the account.</p>
    pub fn set_signin_delegate_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>>) -> Self {
        self.signin_delegate_groups = input;
        self
    }
    /// <p>The sign-in delegate groups associated with the account.</p>
    pub fn get_signin_delegate_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>> {
        &self.signin_delegate_groups
    }
    /// Consumes the builder and constructs a [`Account`](crate::types::Account).
    /// This method will fail if any of the following fields are not set:
    /// - [`aws_account_id`](crate::types::builders::AccountBuilder::aws_account_id)
    /// - [`account_id`](crate::types::builders::AccountBuilder::account_id)
    /// - [`name`](crate::types::builders::AccountBuilder::name)
    pub fn build(self) -> ::std::result::Result<crate::types::Account, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Account {
            aws_account_id: self.aws_account_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "aws_account_id",
                    "aws_account_id was not specified but it is required when building Account",
                )
            })?,
            account_id: self.account_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "account_id",
                    "account_id was not specified but it is required when building Account",
                )
            })?,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building Account",
                )
            })?,
            account_type: self.account_type,
            created_timestamp: self.created_timestamp,
            default_license: self.default_license,
            supported_licenses: self.supported_licenses,
            account_status: self.account_status,
            signin_delegate_groups: self.signin_delegate_groups,
        })
    }
}