registerDelegatedAdministrator method

Future<void> registerDelegatedAdministrator({
  1. required String accountId,
  2. required String servicePrincipal,
})

Enables the specified member account to administer the Organizations features of the specified Amazon Web Services service. It grants read-only access to Organizations service data. The account still requires IAM permissions to access and administer the Amazon Web Services service.

You can run this action only for Amazon Web Services services that support this feature. For a current list of services that support it, see the column Supports Delegated Administrator in the table at Amazon Web Services Services that you can use with Organizations in the Organizations User Guide.

You can only call this operation from the management account.

May throw AccessDeniedException. May throw AccountAlreadyRegisteredException. May throw AccountNotFoundException. May throw AWSOrganizationsNotInUseException. May throw ConcurrentModificationException. May throw ConstraintViolationException. May throw InvalidInputException. May throw ServiceException. May throw TooManyRequestsException. May throw UnsupportedAPIEndpointException.

Parameter accountId : The account ID number of the member account in the organization to register as a delegated administrator.

Parameter servicePrincipal : The service principal of the Amazon Web Services service for which you want to make the member account a delegated administrator.

Implementation

Future<void> registerDelegatedAdministrator({
  required String accountId,
  required String servicePrincipal,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.RegisterDelegatedAdministrator'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AccountId': accountId,
      'ServicePrincipal': servicePrincipal,
    },
  );
}