aws-sdk-chime 1.93.0

AWS SDK for Amazon Chime
Documentation
// 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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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,
        })
    }
}