FindItemsGeneric<TItem extends Item> method

Future<ServiceResponseCollection<FindItemResponse<TItem>>> FindItemsGeneric<TItem extends Item>(
  1. Iterable<FolderId?> parentFolderIds,
  2. SearchFilter? searchFilter,
  3. String? queryString,
  4. ViewBase view,
  5. Grouping? groupBy,
  6. ServiceErrorHandling errorHandlingMode,
)
Copies multiple items in a single call to EWS. The Ids of the items to copy. The Id of the folder to copy the items to. Flag indicating whether service should return new ItemIds or not. What type of error handling should be performed. Copies multiple items in a single call to EWS. The Ids of the items to copy. The Id of the folder to copy the items to. Copies multiple items in a single call to EWS. The Ids of the items to copy. The Id of the folder to copy the items to. Flag indicating whether service should return new ItemIds or not. Copies an item. Calling this method results in a call to EWS. The Id of the item to copy. The Id of the folder to copy the item to. Moves multiple items in a single call to EWS. The Ids of the items to move. The Id of the folder to move the items to. Flag indicating whether service should return new ItemIds or not. What type of error handling should be performed. Moves multiple items in a single call to EWS. The Ids of the items to move. The Id of the folder to move the items to. Moves multiple items in a single call to EWS. The Ids of the items to move. The Id of the folder to move the items to. Flag indicating whether service should return new ItemIds or not. Move an item. The Id of the item to move. The Id of the folder to move the item to. Archives multiple items in a single call to EWS. The Ids of the items to move. The Id of the folder in primary corresponding to which items are being archived to. Finds items. The parent folder ids. The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection query string to be used for indexed search. The view controlling the number of items returned. The group by. Indicates the type of error handling should be done.

Implementation

//ServiceResponseCollection<MoveCopyItemResponse> InternalCopyItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId,
//            bool? returnNewItemIds,
//            ServiceErrorHandling errorHandling)
//        {
//            CopyItemRequest request = new CopyItemRequest(this, errorHandling);
//            request.ItemIds.AddRange(itemIds);
//            request.DestinationFolderId = destinationFolderId;
//            request.ReturnNewItemIds = returnNewItemIds;
//
//            return request.Execute();
//        }

/// <summary>
/// Copies multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to copy.</param>
/// <param name="destinationFolderId">The Id of the folder to copy the items to.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<MoveCopyItemResponse> CopyItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId)
//        {
//            return this.InternalCopyItems(
//                itemIds,
//                destinationFolderId,
//                null,
//                ServiceErrorHandling.ReturnErrors);
//        }

/// <summary>
/// Copies multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to copy.</param>
/// <param name="destinationFolderId">The Id of the folder to copy the items to.</param>
/// <param name="returnNewItemIds">Flag indicating whether service should return new ItemIds or not.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<MoveCopyItemResponse> CopyItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId,
//            bool returnNewItemIds)
//        {
//            EwsUtilities.ValidateMethodVersion(
//                this,
//                ExchangeVersion.Exchange2010_SP1,
//                "CopyItems");
//
//            return this.InternalCopyItems(
//                itemIds,
//                destinationFolderId,
//                returnNewItemIds,
//                ServiceErrorHandling.ReturnErrors);
//        }

/// <summary>
/// Copies an item. Calling this method results in a call to EWS.
/// </summary>
/// <param name="itemId">The Id of the item to copy.</param>
/// <param name="destinationFolderId">The Id of the folder to copy the item to.</param>
/// <returns>The copy of the item.</returns>
//        Item CopyItem(
//            ItemId itemId,
//            FolderId destinationFolderId)
//        {
//            return this.InternalCopyItems(
//                new ItemId[] { itemId },
//                destinationFolderId,
//                null,
//                ServiceErrorHandling.ThrowOnError)[0].Item;
//        }

/// <summary>
/// Moves multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to move.</param>
/// <param name="destinationFolderId">The Id of the folder to move the items to.</param>
/// <param name="returnNewItemIds">Flag indicating whether service should return new ItemIds or not.</param>
/// <param name="errorHandling">What type of error handling should be performed.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<MoveCopyItemResponse> InternalMoveItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId,
//            bool? returnNewItemIds,
//            ServiceErrorHandling errorHandling)
//        {
//            MoveItemRequest request = new MoveItemRequest(this, errorHandling);
//
//            request.ItemIds.AddRange(itemIds);
//            request.DestinationFolderId = destinationFolderId;
//            request.ReturnNewItemIds = returnNewItemIds;
//
//            return request.Execute();
//        }

/// <summary>
/// Moves multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to move.</param>
/// <param name="destinationFolderId">The Id of the folder to move the items to.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<MoveCopyItemResponse> MoveItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId)
//        {
//            return this.InternalMoveItems(
//                itemIds,
//                destinationFolderId,
//                null,
//                ServiceErrorHandling.ReturnErrors);
//        }

/// <summary>
/// Moves multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to move.</param>
/// <param name="destinationFolderId">The Id of the folder to move the items to.</param>
/// <param name="returnNewItemIds">Flag indicating whether service should return new ItemIds or not.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<MoveCopyItemResponse> MoveItems(
//            Iterable<ItemId> itemIds,
//            FolderId destinationFolderId,
//            bool returnNewItemIds)
//        {
//            EwsUtilities.ValidateMethodVersion(
//                this,
//                ExchangeVersion.Exchange2010_SP1,
//                "MoveItems");
//
//            return this.InternalMoveItems(
//                itemIds,
//                destinationFolderId,
//                returnNewItemIds,
//                ServiceErrorHandling.ReturnErrors);
//        }

/// <summary>
/// Move an item.
/// </summary>
/// <param name="itemId">The Id of the item to move.</param>
/// <param name="destinationFolderId">The Id of the folder to move the item to.</param>
/// <returns>The moved item.</returns>
//        Item MoveItem(
//            ItemId itemId,
//            FolderId destinationFolderId)
//        {
//            return this.InternalMoveItems(
//                new ItemId[] { itemId },
//                destinationFolderId,
//                null,
//                ServiceErrorHandling.ThrowOnError)[0].Item;
//        }

/// <summary>
/// Archives multiple items in a single call to EWS.
/// </summary>
/// <param name="itemIds">The Ids of the items to move.</param>
/// <param name="sourceFolderId">The Id of the folder in primary corresponding to which items are being archived to.</param>
/// <returns>A ServiceResponseCollection providing copy results for each of the specified item Ids.</returns>
//ServiceResponseCollection<ArchiveItemResponse> ArchiveItems(
//            Iterable<ItemId> itemIds,
//            FolderId sourceFolderId)
//        {
//            ArchiveItemRequest request = new ArchiveItemRequest(this, ServiceErrorHandling.ReturnErrors);
//
//            request.Ids.AddRange(itemIds);
//            request.SourceFolderId = sourceFolderId;
//
//            return request.Execute();
//        }

/// <summary>
/// Finds items.
/// </summary>
/// <typeparam name="TItem">The type of the item.</typeparam>
/// <param name="parentFolderIds">The parent folder ids.</param>
/// <param name="searchFilter">The search filter. Available search filter classes
/// include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
/// SearchFilter.SearchFilterCollection</param>
/// <param name="queryString">query string to be used for indexed search.</param>
/// <param name="view">The view controlling the number of items returned.</param>
/// <param name="groupBy">The group by.</param>
/// <param name="errorHandlingMode">Indicates the type of error handling should be done.</param>
/// <returns>Service response collection.</returns>
Future<ServiceResponseCollection<FindItemResponse<TItem>>>
    FindItemsGeneric<TItem extends Item>(
        Iterable<FolderId?> parentFolderIds,
        SearchFilter? searchFilter,
        String? queryString,
        ViewBase view,
        Grouping? groupBy,
        ServiceErrorHandling errorHandlingMode) async {
  EwsUtilities.ValidateParamCollection(parentFolderIds, "parentFolderIds");
  EwsUtilities.ValidateParam(view, "view");
  EwsUtilities.ValidateParamAllowNull(groupBy, "groupBy");
  EwsUtilities.ValidateParamAllowNull(queryString, "queryString");
  EwsUtilities.ValidateParamAllowNull(searchFilter, "searchFilter");

  FindItemRequest<TItem> request =
      await new FindItemRequest<TItem>(this, errorHandlingMode);

  request.ParentFolderIds.AddRangeFolderIds(parentFolderIds);
  request.SearchFilter = searchFilter;
  request.QueryString = queryString;
  request.View = view;
  request.GroupBy = groupBy;

  return request.Execute();
}