UpdateItems method

Future<ServiceResponseCollection<UpdateItemResponse>> UpdateItems(
  1. Iterable<Item> items,
  2. FolderId savedItemsDestinationFolderId,
  3. ConflictResolutionMode conflictResolution,
  4. MessageDisposition messageDisposition,
  5. SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode,
  6. bool suppressReadReceipts,
)
Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments. The items to update. The folder in which to save sent messages, meeting invitations or cancellations. If null, the messages, meeting invitation or cancellations are saved in the Sent Items folder. The conflict resolution mode. Indicates the disposition mode for items of type EmailMessage. Required if items contains at least one EmailMessage instance. Indicates if and how invitations and/or cancellations should be sent for items of type Appointment. Required if items contains at least one Appointment instance. Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments. The items to update. The folder in which to save sent messages, meeting invitations or cancellations. If null, the messages, meeting invitation or cancellations are saved in the Sent Items folder. The conflict resolution mode. Indicates the disposition mode for items of type EmailMessage. Required if items contains at least one EmailMessage instance. Indicates if and how invitations and/or cancellations should be sent for items of type Appointment. Required if items contains at least one Appointment instance. Whether to suppress read receipts

Implementation

//ServiceResponseCollection<UpdateItemResponse> UpdateItems(
//            Iterable<Item> items,
//            FolderId savedItemsDestinationFolderId,
//            ConflictResolutionMode conflictResolution,
//            MessageDisposition? messageDisposition,
//            SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode)
//        {
//            return this.UpdateItems(items, savedItemsDestinationFolderId, conflictResolution, messageDisposition, sendInvitationsOrCancellationsMode, false);
//        }

/// <summary>
/// Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments.
/// </summary>
/// <param name="items">The items to update.</param>
/// <param name="savedItemsDestinationFolderId">The folder in which to save sent messages, meeting invitations or cancellations. If null, the messages, meeting invitation or cancellations are saved in the Sent Items folder.</param>
/// <param name="conflictResolution">The conflict resolution mode.</param>
/// <param name="messageDisposition">Indicates the disposition mode for items of type EmailMessage. Required if items contains at least one EmailMessage instance.</param>
/// <param name="sendInvitationsOrCancellationsMode">Indicates if and how invitations and/or cancellations should be sent for items of type Appointment. Required if items contains at least one Appointment instance.</param>
/// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
/// <returns>A ServiceResponseCollection providing update results for each of the specified items.</returns>
Future<ServiceResponseCollection<UpdateItemResponse>> UpdateItems(
    Iterable<Item> items,
    FolderId savedItemsDestinationFolderId,
    ConflictResolutionMode conflictResolution,
    MessageDisposition messageDisposition,
    SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode,
    bool suppressReadReceipts) {
  // All items have to exist on the server (!new) and modified (dirty)
  if (!items.every((item) => (!item.IsNew && item.IsDirty))) {
    throw new ServiceValidationException(
        "Strings.UpdateItemsDoesNotSupportNewOrUnchangedItems");
  }

  // Make sure that all items do *not* have unprocessed attachments.
  if (!items.every((item) => !item.HasUnprocessedAttachmentChanges())) {
    throw new ServiceValidationException(
        "Strings.UpdateItemsDoesNotAllowAttachments");
  }

  return this.InternalUpdateItems(
      items,
      savedItemsDestinationFolderId,
      conflictResolution,
      messageDisposition,
      sendInvitationsOrCancellationsMode,
      ServiceErrorHandling.ReturnErrors,
      suppressReadReceipts);
}