unshareDirectory method

Future<UnshareDirectoryResult> unshareDirectory({
  1. required String directoryId,
  2. required UnshareTarget unshareTarget,
})

Stops the directory sharing between the directory owner and consumer accounts.

May throw EntityDoesNotExistException. May throw InvalidTargetException. May throw DirectoryNotSharedException. May throw ClientException. May throw ServiceException.

Parameter directoryId : The identifier of the AWS Managed Microsoft AD directory that you want to stop sharing.

Parameter unshareTarget : Identifier for the directory consumer account with whom the directory has to be unshared.

Implementation

Future<UnshareDirectoryResult> unshareDirectory({
  required String directoryId,
  required UnshareTarget unshareTarget,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  ArgumentError.checkNotNull(unshareTarget, 'unshareTarget');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'DirectoryService_20150416.UnshareDirectory'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
      'UnshareTarget': unshareTarget,
    },
  );

  return UnshareDirectoryResult.fromJson(jsonResponse.body);
}