BuildSyncFolderHierarchyRequest method

Future<SyncFolderHierarchyRequest> BuildSyncFolderHierarchyRequest(
  1. FolderId syncFolderId,
  2. PropertySet propertySet,
  3. String? syncState
)
Begins an asynchronous request to synchronize the sub-folders of a specific folder. Calling this method results in a call to EWS. The AsyncCallback delegate. An object that contains state information for this request. The Id of the folder containing the items to synchronize with. A null value indicates the root folder of the mailbox. The set of properties to retrieve for synchronized items. The optional sync state representing the point in time when to start the synchronization. Synchronizes the entire folder hierarchy of the mailbox this Service is connected to. Calling this method results in a call to EWS. The set of properties to retrieve for synchronized items. The optional sync state representing the point in time when to start the synchronization. Begins an asynchronous request to synchronize the entire folder hierarchy of the mailbox this Service is connected to. Calling this method results in a call to EWS. The AsyncCallback delegate. An object that contains state information for this request. The set of properties to retrieve for synchronized items. The optional sync state representing the point in time when to start the synchronization. Ends an asynchronous request to synchronize the specified folder hierarchy of the mailbox this Service is connected to. An IAsyncResult that references the asynchronous request. Builds a request to synchronize the specified folder hierarchy of the mailbox this Service is connected to. The Id of the folder containing the items to synchronize with. A null value indicates the root folder of the mailbox. The set of properties to retrieve for synchronized items. The optional sync state representing the point in time when to start the synchronization.

Implementation

//IAsyncResult BeginSyncFolderHierarchy(
//            AsyncCallback callback,
//            object state,
//            FolderId syncFolderId,
//            PropertySet propertySet,
//            string syncState)
//        {
//            return this.BuildSyncFolderHierarchyRequest(
//                syncFolderId,
//                propertySet,
//                syncState).BeginExecute(callback, state);
//        }

/// <summary>
/// Synchronizes the entire folder hierarchy of the mailbox this Service is connected to. Calling this method results in a call to EWS.
/// </summary>
/// <param name="propertySet">The set of properties to retrieve for synchronized items.</param>
/// <param name="syncState">The optional sync state representing the point in time when to start the synchronization.</param>
/// <returns>A ChangeCollection containing a list of changes that occurred in the specified folder.</returns>
//ChangeCollection<FolderChange> SyncFolderHierarchy(PropertySet propertySet, string syncState)
//        {
//            return this.SyncFolderHierarchy(
//                null,
//                propertySet,
//                syncState);
//        }

/// <summary>
/// Begins an asynchronous request to synchronize the entire folder hierarchy of the mailbox this Service is connected to. Calling this method results in a call to EWS.
/// </summary>
/// <param name="callback">The AsyncCallback delegate.</param>
/// <param name="state">An object that contains state information for this request.</param>
/// <param name="propertySet">The set of properties to retrieve for synchronized items.</param>
/// <param name="syncState">The optional sync state representing the point in time when to start the synchronization.</param>
/// <returns>An IAsyncResult that references the asynchronous request.</returns>
//IAsyncResult BeginSyncFolderHierarchy(
//            AsyncCallback callback,
//            object state,
//            PropertySet propertySet,
//            string syncState)
//        {
//            return this.BeginSyncFolderHierarchy(
//                callback,
//                state,
//                null,
//                propertySet,
//                syncState);
//        }

/// <summary>
/// Ends an asynchronous request to synchronize the specified folder hierarchy of the mailbox this Service is connected to.
/// </summary>
/// <param name="asyncResult">An IAsyncResult that references the asynchronous request.</param>
/// <returns>A ChangeCollection containing a list of changes that occurred in the specified folder.</returns>
//ChangeCollection<FolderChange> EndSyncFolderHierarchy(IAsyncResult asyncResult)
//        {
//            var request = AsyncRequestResult.ExtractServiceRequest<SyncFolderHierarchyRequest>(this, asyncResult);
//
//            return request.EndExecute(asyncResult)[0].Changes;
//        }

/// <summary>
/// Builds a request to synchronize the specified folder hierarchy of the mailbox this Service is connected to.
/// </summary>
/// <param name="syncFolderId">The Id of the folder containing the items to synchronize with. A null value indicates the root folder of the mailbox.</param>
/// <param name="propertySet">The set of properties to retrieve for synchronized items.</param>
/// <param name="syncState">The optional sync state representing the point in time when to start the synchronization.</param>
/// <returns>A request to synchronize the specified folder hierarchy of the mailbox this Service is connected to.</returns>
Future<SyncFolderHierarchyRequest> BuildSyncFolderHierarchyRequest(
    FolderId syncFolderId, PropertySet propertySet, String? syncState) async {
  EwsUtilities.ValidateParamAllowNull(
      syncFolderId, "syncFolderId"); // Null syncFolderId is allowed
  EwsUtilities.ValidateParam(propertySet, "propertySet");

  SyncFolderHierarchyRequest request =
      await new SyncFolderHierarchyRequest(this);

  request.PropertySet = propertySet;
  request.SyncFolderId = syncFolderId;
  request.SyncState = syncState;

  return request;
}