deregisterWorkspaceDirectory method

Future<void> deregisterWorkspaceDirectory({
  1. required String directoryId,
})

Deregisters the specified directory. This operation is asynchronous and returns before the WorkSpace directory is deregistered. If any WorkSpaces are registered to this directory, you must remove them before you can deregister the directory.

To delete empty directories, see Delete the Directory for Your WorkSpaces. If you delete your Simple AD or AD Connector directory, you can always create a new one when you want to start using WorkSpaces again.

May throw AccessDeniedException. May throw InvalidParameterValuesException. May throw OperationNotSupportedException. May throw ResourceNotFoundException. May throw InvalidResourceStateException.

Parameter directoryId : The identifier of the directory. If any WorkSpaces are registered to this directory, you must remove them before you deregister the directory, or you will receive an OperationNotSupportedException error.

Implementation

Future<void> deregisterWorkspaceDirectory({
  required String directoryId,
}) async {
  ArgumentError.checkNotNull(directoryId, 'directoryId');
  _s.validateStringLength(
    'directoryId',
    directoryId,
    10,
    65,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkspacesService.DeregisterWorkspaceDirectory'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DirectoryId': directoryId,
    },
  );
}