// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateAccountInput {
/// <p>The email address of the owner to assign to the new member account. This email address must not already be associated with another Amazon Web Services account. You must use a valid email address to complete account creation.</p>
/// <p>The rules for a valid email address:</p>
/// <ul>
/// <li>
/// <p>The address must be a minimum of 6 and a maximum of 64 characters long.</p></li>
/// <li>
/// <p>All characters must be 7-bit ASCII characters.</p></li>
/// <li>
/// <p>There must be one and only one @ symbol, which separates the local name from the domain name.</p></li>
/// <li>
/// <p>The local name can't contain any of the following characters:</p>
/// <p>whitespace, " ' ( ) < > \[ \] : ; , \ | % &</p></li>
/// <li>
/// <p>The local name can't begin with a dot (.)</p></li>
/// <li>
/// <p>The domain name can consist of only the characters \[a-z\],\[A-Z\],\[0-9\], hyphen (-), or dot (.)</p></li>
/// <li>
/// <p>The domain name can't begin or end with a hyphen (-) or dot (.)</p></li>
/// <li>
/// <p>The domain name must contain at least one dot</p></li>
/// </ul>
/// <p>You can't access the root user of the account or remove an account that was created with an invalid email address.</p>
pub email: ::std::option::Option<::std::string::String>,
/// <p>The friendly name of the member account.</p>
pub account_name: ::std::option::Option<::std::string::String>,
/// <p>The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator. The role has administrator permissions in the new member account.</p>
/// <p>If you don't specify this parameter, the role name defaults to <code>OrganizationAccountAccessRole</code>.</p>
/// <p>For more information about how to use this role to access the member account, see the following links:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role">Creating the OrganizationAccountAccessRole in an invited member account</a> in the <i>Organizations User Guide</i></p></li>
/// <li>
/// <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles</a> in the <i>IAM User Guide</i></p></li>
/// </ul>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter. The pattern can include uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-</p>
pub role_name: ::std::option::Option<::std::string::String>,
/// <p>If set to <code>ALLOW</code>, the new account enables IAM users to access account billing information <i>if</i> they have the required permissions. If set to <code>DENY</code>, only the root user of the new account can access account billing information. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate">About IAM access to the Billing and Cost Management console</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
/// <p>If you don't specify this parameter, the value defaults to <code>ALLOW</code>, and IAM users and roles with the required permissions can access billing information for the new account.</p>
pub iam_user_access_to_billing: ::std::option::Option<crate::types::IamUserAccessToBilling>,
/// <p>A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to <code>null</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html">Tagging Organizations resources</a> in the Organizations User Guide.</p><note>
/// <p>If any one of the tags is not valid or if you exceed the maximum allowed number of tags for an account, then the entire request fails and the account is not created.</p>
/// </note>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateAccountInput {
/// <p>The email address of the owner to assign to the new member account. This email address must not already be associated with another Amazon Web Services account. You must use a valid email address to complete account creation.</p>
/// <p>The rules for a valid email address:</p>
/// <ul>
/// <li>
/// <p>The address must be a minimum of 6 and a maximum of 64 characters long.</p></li>
/// <li>
/// <p>All characters must be 7-bit ASCII characters.</p></li>
/// <li>
/// <p>There must be one and only one @ symbol, which separates the local name from the domain name.</p></li>
/// <li>
/// <p>The local name can't contain any of the following characters:</p>
/// <p>whitespace, " ' ( ) < > \[ \] : ; , \ | % &</p></li>
/// <li>
/// <p>The local name can't begin with a dot (.)</p></li>
/// <li>
/// <p>The domain name can consist of only the characters \[a-z\],\[A-Z\],\[0-9\], hyphen (-), or dot (.)</p></li>
/// <li>
/// <p>The domain name can't begin or end with a hyphen (-) or dot (.)</p></li>
/// <li>
/// <p>The domain name must contain at least one dot</p></li>
/// </ul>
/// <p>You can't access the root user of the account or remove an account that was created with an invalid email address.</p>
pub fn email(&self) -> ::std::option::Option<&str> {
self.email.as_deref()
}
/// <p>The friendly name of the member account.</p>
pub fn account_name(&self) -> ::std::option::Option<&str> {
self.account_name.as_deref()
}
/// <p>The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator. The role has administrator permissions in the new member account.</p>
/// <p>If you don't specify this parameter, the role name defaults to <code>OrganizationAccountAccessRole</code>.</p>
/// <p>For more information about how to use this role to access the member account, see the following links:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role">Creating the OrganizationAccountAccessRole in an invited member account</a> in the <i>Organizations User Guide</i></p></li>
/// <li>
/// <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles</a> in the <i>IAM User Guide</i></p></li>
/// </ul>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter. The pattern can include uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-</p>
pub fn role_name(&self) -> ::std::option::Option<&str> {
self.role_name.as_deref()
}
/// <p>If set to <code>ALLOW</code>, the new account enables IAM users to access account billing information <i>if</i> they have the required permissions. If set to <code>DENY</code>, only the root user of the new account can access account billing information. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate">About IAM access to the Billing and Cost Management console</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
/// <p>If you don't specify this parameter, the value defaults to <code>ALLOW</code>, and IAM users and roles with the required permissions can access billing information for the new account.</p>
pub fn iam_user_access_to_billing(&self) -> ::std::option::Option<&crate::types::IamUserAccessToBilling> {
self.iam_user_access_to_billing.as_ref()
}
/// <p>A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to <code>null</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html">Tagging Organizations resources</a> in the Organizations User Guide.</p><note>
/// <p>If any one of the tags is not valid or if you exceed the maximum allowed number of tags for an account, then the entire request fails and the account is not created.</p>
/// </note>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for CreateAccountInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateAccountInput");
formatter.field("email", &"*** Sensitive Data Redacted ***");
formatter.field("account_name", &"*** Sensitive Data Redacted ***");
formatter.field("role_name", &self.role_name);
formatter.field("iam_user_access_to_billing", &self.iam_user_access_to_billing);
formatter.field("tags", &self.tags);
formatter.finish()
}
}
impl CreateAccountInput {
/// Creates a new builder-style object to manufacture [`CreateAccountInput`](crate::operation::create_account::CreateAccountInput).
pub fn builder() -> crate::operation::create_account::builders::CreateAccountInputBuilder {
crate::operation::create_account::builders::CreateAccountInputBuilder::default()
}
}
/// A builder for [`CreateAccountInput`](crate::operation::create_account::CreateAccountInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateAccountInputBuilder {
pub(crate) email: ::std::option::Option<::std::string::String>,
pub(crate) account_name: ::std::option::Option<::std::string::String>,
pub(crate) role_name: ::std::option::Option<::std::string::String>,
pub(crate) iam_user_access_to_billing: ::std::option::Option<crate::types::IamUserAccessToBilling>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateAccountInputBuilder {
/// <p>The email address of the owner to assign to the new member account. This email address must not already be associated with another Amazon Web Services account. You must use a valid email address to complete account creation.</p>
/// <p>The rules for a valid email address:</p>
/// <ul>
/// <li>
/// <p>The address must be a minimum of 6 and a maximum of 64 characters long.</p></li>
/// <li>
/// <p>All characters must be 7-bit ASCII characters.</p></li>
/// <li>
/// <p>There must be one and only one @ symbol, which separates the local name from the domain name.</p></li>
/// <li>
/// <p>The local name can't contain any of the following characters:</p>
/// <p>whitespace, " ' ( ) < > \[ \] : ; , \ | % &</p></li>
/// <li>
/// <p>The local name can't begin with a dot (.)</p></li>
/// <li>
/// <p>The domain name can consist of only the characters \[a-z\],\[A-Z\],\[0-9\], hyphen (-), or dot (.)</p></li>
/// <li>
/// <p>The domain name can't begin or end with a hyphen (-) or dot (.)</p></li>
/// <li>
/// <p>The domain name must contain at least one dot</p></li>
/// </ul>
/// <p>You can't access the root user of the account or remove an account that was created with an invalid email address.</p>
/// This field is required.
pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.email = ::std::option::Option::Some(input.into());
self
}
/// <p>The email address of the owner to assign to the new member account. This email address must not already be associated with another Amazon Web Services account. You must use a valid email address to complete account creation.</p>
/// <p>The rules for a valid email address:</p>
/// <ul>
/// <li>
/// <p>The address must be a minimum of 6 and a maximum of 64 characters long.</p></li>
/// <li>
/// <p>All characters must be 7-bit ASCII characters.</p></li>
/// <li>
/// <p>There must be one and only one @ symbol, which separates the local name from the domain name.</p></li>
/// <li>
/// <p>The local name can't contain any of the following characters:</p>
/// <p>whitespace, " ' ( ) < > \[ \] : ; , \ | % &</p></li>
/// <li>
/// <p>The local name can't begin with a dot (.)</p></li>
/// <li>
/// <p>The domain name can consist of only the characters \[a-z\],\[A-Z\],\[0-9\], hyphen (-), or dot (.)</p></li>
/// <li>
/// <p>The domain name can't begin or end with a hyphen (-) or dot (.)</p></li>
/// <li>
/// <p>The domain name must contain at least one dot</p></li>
/// </ul>
/// <p>You can't access the root user of the account or remove an account that was created with an invalid email address.</p>
pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.email = input;
self
}
/// <p>The email address of the owner to assign to the new member account. This email address must not already be associated with another Amazon Web Services account. You must use a valid email address to complete account creation.</p>
/// <p>The rules for a valid email address:</p>
/// <ul>
/// <li>
/// <p>The address must be a minimum of 6 and a maximum of 64 characters long.</p></li>
/// <li>
/// <p>All characters must be 7-bit ASCII characters.</p></li>
/// <li>
/// <p>There must be one and only one @ symbol, which separates the local name from the domain name.</p></li>
/// <li>
/// <p>The local name can't contain any of the following characters:</p>
/// <p>whitespace, " ' ( ) < > \[ \] : ; , \ | % &</p></li>
/// <li>
/// <p>The local name can't begin with a dot (.)</p></li>
/// <li>
/// <p>The domain name can consist of only the characters \[a-z\],\[A-Z\],\[0-9\], hyphen (-), or dot (.)</p></li>
/// <li>
/// <p>The domain name can't begin or end with a hyphen (-) or dot (.)</p></li>
/// <li>
/// <p>The domain name must contain at least one dot</p></li>
/// </ul>
/// <p>You can't access the root user of the account or remove an account that was created with an invalid email address.</p>
pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
&self.email
}
/// <p>The friendly name of the member account.</p>
/// This field is required.
pub fn account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.account_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The friendly name of the member account.</p>
pub fn set_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.account_name = input;
self
}
/// <p>The friendly name of the member account.</p>
pub fn get_account_name(&self) -> &::std::option::Option<::std::string::String> {
&self.account_name
}
/// <p>The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator. The role has administrator permissions in the new member account.</p>
/// <p>If you don't specify this parameter, the role name defaults to <code>OrganizationAccountAccessRole</code>.</p>
/// <p>For more information about how to use this role to access the member account, see the following links:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role">Creating the OrganizationAccountAccessRole in an invited member account</a> in the <i>Organizations User Guide</i></p></li>
/// <li>
/// <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles</a> in the <i>IAM User Guide</i></p></li>
/// </ul>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter. The pattern can include uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-</p>
pub fn role_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.role_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator. The role has administrator permissions in the new member account.</p>
/// <p>If you don't specify this parameter, the role name defaults to <code>OrganizationAccountAccessRole</code>.</p>
/// <p>For more information about how to use this role to access the member account, see the following links:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role">Creating the OrganizationAccountAccessRole in an invited member account</a> in the <i>Organizations User Guide</i></p></li>
/// <li>
/// <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles</a> in the <i>IAM User Guide</i></p></li>
/// </ul>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter. The pattern can include uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-</p>
pub fn set_role_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.role_name = input;
self
}
/// <p>The name of an IAM role that Organizations automatically preconfigures in the new member account. This role trusts the management account, allowing users in the management account to assume the role, as permitted by the management account administrator. The role has administrator permissions in the new member account.</p>
/// <p>If you don't specify this parameter, the role name defaults to <code>OrganizationAccountAccessRole</code>.</p>
/// <p>For more information about how to use this role to access the member account, see the following links:</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role">Creating the OrganizationAccountAccessRole in an invited member account</a> in the <i>Organizations User Guide</i></p></li>
/// <li>
/// <p>Steps 2 and 3 in <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html">IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles</a> in the <i>IAM User Guide</i></p></li>
/// </ul>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter. The pattern can include uppercase letters, lowercase letters, digits with no spaces, and any of the following characters: =,.@-</p>
pub fn get_role_name(&self) -> &::std::option::Option<::std::string::String> {
&self.role_name
}
/// <p>If set to <code>ALLOW</code>, the new account enables IAM users to access account billing information <i>if</i> they have the required permissions. If set to <code>DENY</code>, only the root user of the new account can access account billing information. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate">About IAM access to the Billing and Cost Management console</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
/// <p>If you don't specify this parameter, the value defaults to <code>ALLOW</code>, and IAM users and roles with the required permissions can access billing information for the new account.</p>
pub fn iam_user_access_to_billing(mut self, input: crate::types::IamUserAccessToBilling) -> Self {
self.iam_user_access_to_billing = ::std::option::Option::Some(input);
self
}
/// <p>If set to <code>ALLOW</code>, the new account enables IAM users to access account billing information <i>if</i> they have the required permissions. If set to <code>DENY</code>, only the root user of the new account can access account billing information. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate">About IAM access to the Billing and Cost Management console</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
/// <p>If you don't specify this parameter, the value defaults to <code>ALLOW</code>, and IAM users and roles with the required permissions can access billing information for the new account.</p>
pub fn set_iam_user_access_to_billing(mut self, input: ::std::option::Option<crate::types::IamUserAccessToBilling>) -> Self {
self.iam_user_access_to_billing = input;
self
}
/// <p>If set to <code>ALLOW</code>, the new account enables IAM users to access account billing information <i>if</i> they have the required permissions. If set to <code>DENY</code>, only the root user of the new account can access account billing information. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate">About IAM access to the Billing and Cost Management console</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
/// <p>If you don't specify this parameter, the value defaults to <code>ALLOW</code>, and IAM users and roles with the required permissions can access billing information for the new account.</p>
pub fn get_iam_user_access_to_billing(&self) -> &::std::option::Option<crate::types::IamUserAccessToBilling> {
&self.iam_user_access_to_billing
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to <code>null</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html">Tagging Organizations resources</a> in the Organizations User Guide.</p><note>
/// <p>If any one of the tags is not valid or if you exceed the maximum allowed number of tags for an account, then the entire request fails and the account is not created.</p>
/// </note>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to <code>null</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html">Tagging Organizations resources</a> in the Organizations User Guide.</p><note>
/// <p>If any one of the tags is not valid or if you exceed the maximum allowed number of tags for an account, then the entire request fails and the account is not created.</p>
/// </note>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>A list of tags that you want to attach to the newly created account. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to <code>null</code>. For more information about tagging, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html">Tagging Organizations resources</a> in the Organizations User Guide.</p><note>
/// <p>If any one of the tags is not valid or if you exceed the maximum allowed number of tags for an account, then the entire request fails and the account is not created.</p>
/// </note>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Consumes the builder and constructs a [`CreateAccountInput`](crate::operation::create_account::CreateAccountInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_account::CreateAccountInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_account::CreateAccountInput {
email: self.email,
account_name: self.account_name,
role_name: self.role_name,
iam_user_access_to_billing: self.iam_user_access_to_billing,
tags: self.tags,
})
}
}
impl ::std::fmt::Debug for CreateAccountInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateAccountInputBuilder");
formatter.field("email", &"*** Sensitive Data Redacted ***");
formatter.field("account_name", &"*** Sensitive Data Redacted ***");
formatter.field("role_name", &self.role_name);
formatter.field("iam_user_access_to_billing", &self.iam_user_access_to_billing);
formatter.field("tags", &self.tags);
formatter.finish()
}
}