FindItemsWithFolderIdAndFilterAndViewAndGrouping method

Future<GroupedFindItemsResults<Item>?> FindItemsWithFolderIdAndFilterAndViewAndGrouping(
  1. FolderId parentFolderId,
  2. SearchFilter searchFilter,
  3. ViewBase view,
  4. Grouping groupBy,
)
Obtains a grouped list of items by searching the contents of a specific folder. Calling this method results in a call to EWS. The Id of the folder in which to search for items. The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection The view controlling the number of items returned. The group by clause.

Implementation

Future<GroupedFindItemsResults<Item>?>
    FindItemsWithFolderIdAndFilterAndViewAndGrouping(FolderId parentFolderId,
        SearchFilter searchFilter, ViewBase view, Grouping groupBy) async {
  EwsUtilities.ValidateParam(groupBy, "groupBy");
  EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");

  ServiceResponseCollection<FindItemResponse<Item>> responses =
      await this.FindItemsGeneric<Item>(
          [parentFolderId],
          searchFilter,
          null,
          /* queryString */
          view,
          groupBy,
          ServiceErrorHandling.ThrowOnError);

  return responses[0].GroupedFindResults;
}