deleteDirectory method
Deletes an AWS Directory Service directory.
Before you call DeleteDirectory
, ensure that all of the
required permissions have been explicitly granted through a policy. For
details about what permissions are required to run the
DeleteDirectory
operation, see AWS
Directory Service API Permissions: Actions, Resources, and Conditions
Reference.
May throw EntityDoesNotExistException. May throw ClientException. May throw ServiceException.
Parameter directoryId
:
The identifier of the directory to delete.
Implementation
Future<DeleteDirectoryResult> deleteDirectory({
required String directoryId,
}) async {
ArgumentError.checkNotNull(directoryId, 'directoryId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'DirectoryService_20150416.DeleteDirectory'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DirectoryId': directoryId,
},
);
return DeleteDirectoryResult.fromJson(jsonResponse.body);
}