SubscribeToPullNotifications method

Future<PullSubscription> SubscribeToPullNotifications(
  1. Iterable<FolderId> folderIds,
  2. int timeout,
  3. String? watermark,
  4. List<EventType> eventTypes,
)
Subscribes to pull notifications. Calling this method results in a call to EWS. The Ids of the folder to subscribe to. The timeout, in minutes, after which the subscription expires. Timeout must be between 1 and 1440. An optional watermark representing a previously opened subscription. The event types to subscribe to.

Implementation

Future<PullSubscription> SubscribeToPullNotifications(
  Iterable<FolderId> folderIds,
  int timeout,
  String? watermark,
  List<EventType> eventTypes,
) async {
  EwsUtilities.ValidateParamCollection(folderIds, "folderIds");

  return (await BuildSubscribeToPullNotificationsRequest(
    folderIds,
    timeout,
    watermark,
    eventTypes,
  ).Execute())[0].Subscription!;
}