DeleteFolder method

Future<void> DeleteFolder(
  1. FolderId? folderId,
  2. DeleteMode deleteMode
)
Deletes a folder. Calling this method results in a call to EWS. The folder id. The delete mode.

Implementation

Future<void> DeleteFolder(FolderId? folderId, DeleteMode deleteMode) {
  EwsUtilities.ValidateParam(folderId, "folderId");

  DeleteFolderRequest request =
      new DeleteFolderRequest(this, ServiceErrorHandling.ThrowOnError);

  request.FolderIds.AddFolderId(folderId);
  request.DeleteMode = deleteMode;

  return request.Execute();
}