describeAccount method
Retrieves AWS Organizations-related information about the specified account.
This operation can be called only from the organization's management account or by a member account that is a delegated administrator for an AWS service.
May throw AccessDeniedException. May throw AccountNotFoundException. May throw AWSOrganizationsNotInUseException. May throw InvalidInputException. May throw ServiceException. May throw TooManyRequestsException.
Parameter accountId
:
The unique identifier (ID) of the AWS account that you want information
about. You can get the ID from the ListAccounts or
ListAccountsForParent operations.
The regex pattern for an account ID string requires exactly 12 digits.
Implementation
Future<DescribeAccountResponse> describeAccount({
required String accountId,
}) async {
ArgumentError.checkNotNull(accountId, 'accountId');
_s.validateStringLength(
'accountId',
accountId,
0,
12,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSOrganizationsV20161128.DescribeAccount'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AccountId': accountId,
},
);
return DescribeAccountResponse.fromJson(jsonResponse.body);
}