// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_account::_create_account_input::CreateAccountInputBuilder;
pub use crate::operation::create_account::_create_account_output::CreateAccountOutputBuilder;
impl crate::operation::create_account::builders::CreateAccountInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::create_account::CreateAccountOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_account::CreateAccountError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.create_account();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `CreateAccount`.
///
/// <p>Creates an Amazon Web Services account that is automatically a member of the organization whose credentials made the request. This is an asynchronous request that Amazon Web Services performs in the background. Because <code>CreateAccount</code> operates asynchronously, it can return a successful completion message even though account initialization might still be in progress. You might need to wait a few minutes before you can successfully access the account. To check the status of the request, do one of the following:</p>
/// <ul>
/// <li>
/// <p>Use the <code>Id</code> value of the <code>CreateAccountStatus</code> response element from this operation to provide as a parameter to the <code>DescribeCreateAccountStatus</code> operation.</p></li>
/// <li>
/// <p>Check the CloudTrail log for the <code>CreateAccountResult</code> event. For information on using CloudTrail with Organizations, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration">Logging and monitoring in Organizations</a> in the <i>Organizations User Guide</i>.</p></li>
/// </ul>
/// <p>Additionally, the <code>AccountJoinedOrganization</code> event is logged in CloudTrail and is available only in the management account's event history. This event includes <code>joinedMethod:Created</code> and <code>joinedTime</code> fields to provide context on how and when the account joined the organization.</p>
/// <p>The user who calls the API to create an account must have the <code>organizations:CreateAccount</code> permission. If you enabled all features in the organization, Organizations creates the required service-linked role named <code>AWSServiceRoleForOrganizations</code>. For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs">Organizations and service-linked roles</a> in the <i>Organizations User Guide</i>.</p>
/// <p>If the request includes tags, then the requester must have the <code>organizations:TagResource</code> permission.</p>
/// <p>Organizations preconfigures the new member account with a role (named <code>OrganizationAccountAccessRole</code> by default) that grants users in the management account administrator permissions in the new member account. Principals in the management account can assume the role. Organizations clones the company name and address information for the new account from the organization's management account.</p>
/// <p>You can only call this operation from the management account.</p>
/// <p>For more information about creating accounts, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html">Creating a member account in your organization</a> in the <i>Organizations User Guide</i>.</p><important>
/// <ul>
/// <li>
/// <p>When you create an account in an organization using the Organizations console, API, or CLI commands, the information required for the account to operate as a standalone account, such as a payment method is <i>not</i> automatically collected. If you must remove an account from your organization later, you can do so only after you provide the missing information. For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html">Considerations before removing an account from an organization</a> in the <i>Organizations User Guide</i>.</p></li>
/// <li>
/// <p>If you get an exception that indicates that you exceeded your account limits for the organization, contact <a href="https://console.aws.amazon.com/support/home#/">Amazon Web Services Support</a>.</p></li>
/// <li>
/// <p>If you get an exception that indicates that the operation failed because your organization is still initializing, wait one hour and then try again. If the error persists, contact <a href="https://console.aws.amazon.com/support/home#/">Amazon Web Services Support</a>.</p></li>
/// <li>
/// <p>It isn't recommended to use <code>CreateAccount</code> to create multiple temporary accounts, and using the <code>CreateAccount</code> API to close accounts is subject to a 30-day usage quota. For information on the requirements and process for closing an account, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html">Closing a member account in your organization</a> in the <i>Organizations User Guide</i>.</p></li>
/// </ul>
/// </important> <note>
/// <p>When you create a member account with this operation, you can choose whether to create the account with the <b>IAM User and Role Access to Billing Information</b> switch enabled. If you enable it, IAM users and roles that have appropriate permissions can view billing information for the account. If you disable it, only the account root user can access billing information. For information about how to disable this switch for an account, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html#grantaccess">Granting access to your billing information and tools</a>.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateAccountFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::create_account::builders::CreateAccountInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::create_account::CreateAccountOutput,
crate::operation::create_account::CreateAccountError,
> for CreateAccountFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::create_account::CreateAccountOutput,
crate::operation::create_account::CreateAccountError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl CreateAccountFluentBuilder {
/// Creates a new `CreateAccountFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the CreateAccount as a reference.
pub fn as_input(&self) -> &crate::operation::create_account::builders::CreateAccountInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::create_account::CreateAccountOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::create_account::CreateAccountError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::create_account::CreateAccount::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::create_account::CreateAccount::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::create_account::CreateAccountOutput,
crate::operation::create_account::CreateAccountError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
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 email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.email(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.inner = self.inner.set_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.inner.get_email()
}
/// <p>The friendly name of the member account.</p>
pub fn account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.account_name(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.role_name(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.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 set_iam_user_access_to_billing(mut self, input: ::std::option::Option<crate::types::IamUserAccessToBilling>) -> Self {
self.inner = self.inner.set_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.inner.get_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 {
self.inner = self.inner.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 set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.inner = self.inner.set_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.inner.get_tags()
}
}