deregisterDelegatedAdministrator method
Removes the specified member Amazon Web Services account as a delegated administrator for the specified 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 AccountNotFoundException.
May throw AccountNotRegisteredException.
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 that you
want to deregister as a delegated administrator.
Parameter servicePrincipal :
The service principal name of an Amazon Web Services service for which the
account is a delegated administrator.
Delegated administrator privileges are revoked for only the specified Amazon Web Services service from the member account. If the specified service is the only service for which the member account is a delegated administrator, the operation also revokes Organizations read action permissions.
Implementation
Future<void> deregisterDelegatedAdministrator({
required String accountId,
required String servicePrincipal,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AWSOrganizationsV20161128.DeregisterDelegatedAdministrator'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AccountId': accountId,
'ServicePrincipal': servicePrincipal,
},
);
}