SubscribeToStreamingNotifications method

Future<StreamingSubscription> SubscribeToStreamingNotifications(
  1. Iterable<FolderId> folderIds,
  2. List<EventType> eventTypes
)
Subscribes to streaming notifications. Calling this method results in a call to EWS. The Ids of the folder to subscribe to. The event types to subscribe to.

Implementation

Future<StreamingSubscription> SubscribeToStreamingNotifications(
  Iterable<FolderId> folderIds,
  List<EventType> eventTypes,
) async {
  EwsUtilities.ValidateMethodVersion(
    this,
    ExchangeVersion.Exchange2010_SP1,
    "SubscribeToStreamingNotifications",
  );

  EwsUtilities.ValidateParamCollection(folderIds, "folderIds");
  final ServiceResponseCollection<SubscribeResponse<StreamingSubscription>>
  response = await BuildSubscribeToStreamingNotificationsRequest(
    folderIds,
    eventTypes,
  ).Execute();
  return response[0].Subscription!;
}