#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Account {
pub aws_account_id: ::std::string::String,
pub account_id: ::std::string::String,
pub name: ::std::string::String,
pub account_type: ::std::option::Option<crate::types::AccountType>,
pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
pub default_license: ::std::option::Option<crate::types::License>,
pub supported_licenses: ::std::option::Option<::std::vec::Vec<crate::types::License>>,
pub account_status: ::std::option::Option<crate::types::AccountStatus>,
pub signin_delegate_groups: ::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>>,
}
impl Account {
pub fn aws_account_id(&self) -> &str {
use std::ops::Deref;
self.aws_account_id.deref()
}
pub fn account_id(&self) -> &str {
use std::ops::Deref;
self.account_id.deref()
}
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn account_type(&self) -> ::std::option::Option<&crate::types::AccountType> {
self.account_type.as_ref()
}
pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.created_timestamp.as_ref()
}
pub fn default_license(&self) -> ::std::option::Option<&crate::types::License> {
self.default_license.as_ref()
}
pub fn supported_licenses(&self) -> &[crate::types::License] {
self.supported_licenses.as_deref().unwrap_or_default()
}
pub fn account_status(&self) -> ::std::option::Option<&crate::types::AccountStatus> {
self.account_status.as_ref()
}
pub fn signin_delegate_groups(&self) -> &[crate::types::SigninDelegateGroup] {
self.signin_delegate_groups.as_deref().unwrap_or_default()
}
}
impl Account {
pub fn builder() -> crate::types::builders::AccountBuilder {
crate::types::builders::AccountBuilder::default()
}
}
#[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 {
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
}
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.aws_account_id = input;
self
}
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.aws_account_id
}
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
}
pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_id = input;
self
}
pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.account_id
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn account_type(mut self, input: crate::types::AccountType) -> Self {
self.account_type = ::std::option::Option::Some(input);
self
}
pub fn set_account_type(mut self, input: ::std::option::Option<crate::types::AccountType>) -> Self {
self.account_type = input;
self
}
pub fn get_account_type(&self) -> &::std::option::Option<crate::types::AccountType> {
&self.account_type
}
pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_timestamp = ::std::option::Option::Some(input);
self
}
pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_timestamp = input;
self
}
pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_timestamp
}
pub fn default_license(mut self, input: crate::types::License) -> Self {
self.default_license = ::std::option::Option::Some(input);
self
}
pub fn set_default_license(mut self, input: ::std::option::Option<crate::types::License>) -> Self {
self.default_license = input;
self
}
pub fn get_default_license(&self) -> &::std::option::Option<crate::types::License> {
&self.default_license
}
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
}
pub fn set_supported_licenses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::License>>) -> Self {
self.supported_licenses = input;
self
}
pub fn get_supported_licenses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::License>> {
&self.supported_licenses
}
pub fn account_status(mut self, input: crate::types::AccountStatus) -> Self {
self.account_status = ::std::option::Option::Some(input);
self
}
pub fn set_account_status(mut self, input: ::std::option::Option<crate::types::AccountStatus>) -> Self {
self.account_status = input;
self
}
pub fn get_account_status(&self) -> &::std::option::Option<crate::types::AccountStatus> {
&self.account_status
}
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
}
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
}
pub fn get_signin_delegate_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SigninDelegateGroup>> {
&self.signin_delegate_groups
}
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,
})
}
}