BuildSubscribeToPushNotificationsRequest method

SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsRequest(
  1. Iterable<FolderId>? folderIds,
  2. Uri url,
  3. int frequency,
  4. String? watermark,
  5. String? callerData,
  6. String? anchorMailbox,
  7. List<EventType> eventTypes,
)
Set a TeamMailbox TeamMailbox email address SharePoint site URL TeamMailbox lifecycle state Unpin a TeamMailbox TeamMailbox email address Builds an request to request to subscribe to push notifications in the authenticated user's mailbox. The Ids of the folder to subscribe to. The URL of the Web Service endpoint the Exchange server should push events to. The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440. An optional watermark representing a previously opened subscription. Optional caller data that will be returned the call back. The smtpaddress of the mailbox to subscribe to. The event types to subscribe to.

Implementation

//void SetTeamMailbox(EmailAddress emailAddress, Uri sharePointSiteUrl, TeamMailboxLifecycleState state)
//        {
//            EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013, "SetTeamMailbox");
//
//            if (emailAddress == null)
//            {
//                throw new ArgumentNullException("emailAddress");
//            }
//
//            if (sharePointSiteUrl == null)
//            {
//                throw new ArgumentNullException("sharePointSiteUrl");
//            }
//
//            SetTeamMailboxRequest request = new SetTeamMailboxRequest(this, emailAddress, sharePointSiteUrl, state);
//            request.Execute();
//        }

/// <summary>
/// Unpin a TeamMailbox
/// </summary>
/// <param name="emailAddress">TeamMailbox email address</param>
//void UnpinTeamMailbox(EmailAddress emailAddress)
//        {
//            EwsUtilities.ValidateMethodVersion(this, ExchangeVersion.Exchange2013, "UnpinTeamMailbox");
//
//            if (emailAddress == null)
//            {
//                throw new ArgumentNullException("emailAddress");
//            }
//
//            UnpinTeamMailboxRequest request = new UnpinTeamMailboxRequest(this, emailAddress);
//            request.Execute();
//        }

/// <summary>
/// Builds an request to request to subscribe to push notifications in the authenticated user's mailbox.
/// </summary>
/// <param name="folderIds">The Ids of the folder to subscribe to.</param>
/// <param name="url">The URL of the Web Service endpoint the Exchange server should push events to.</param>
/// <param name="frequency">The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440.</param>
/// <param name="watermark">An optional watermark representing a previously opened subscription.</param>
/// <param name="callerData">Optional caller data that will be returned the call back.</param>
/// <param name="anchorMailbox">The smtpaddress of the mailbox to subscribe to.</param>
/// <param name="eventTypes">The event types to subscribe to.</param>
/// <returns>A request to request to subscribe to push notifications in the authenticated user's mailbox.</returns>
SubscribeToPushNotificationsRequest BuildSubscribeToPushNotificationsRequest(
  Iterable<FolderId>? folderIds,
  Uri url,
  int frequency,
  String? watermark,
  String? callerData,
  String? anchorMailbox,
  List<EventType> eventTypes,
) {
  EwsUtilities.ValidateParam(url, "url");

  if (frequency < 1 || frequency > 1440) {
    throw ArgumentException(
      "The frequency must be a value between 1 and 1440.",
    );
  }

  EwsUtilities.ValidateParamCollection(eventTypes, "eventTypes");

  SubscribeToPushNotificationsRequest request =
      SubscribeToPushNotificationsRequest(this);
  request.AnchorMailbox = anchorMailbox;

  if (folderIds != null) {
    request.FolderIds!.AddRangeFolderIds(folderIds);
  }

  request.Url = url;
  request.Frequency = frequency;
  request.EventTypes.addAll(eventTypes);
  request.Watermark = watermark;
  request.CallerData = callerData;

  return request;
}