Validate method

  1. @override
void Validate()
override
Validate request.

Implementation

@override
void Validate() {
  super.Validate();
  EwsUtilities.ValidateParam(this.FolderIds, "FolderIds");
  EwsUtilities.ValidateParamCollection(this.EventTypes, "EventTypes");
  this.FolderIds!.Validate(this.Service.RequestedServerVersion);

  // Check that caller isn't trying to subscribe to Status events.
  if (this
          .EventTypes
          .where((eventType) => (eventType == EventType.Status))
          .length >
      0) {
    throw new ServiceValidationException(
        "Strings.CannotSubscribeToStatusEvents");
  }

  // If Watermark was specified, make sure it's not a blank string.
  if (!StringUtils.IsNullOrEmpty(this.Watermark)) {
    EwsUtilities.ValidateNonBlankStringParam(this.Watermark, "Watermark");
  }

  this.EventTypes.forEach((eventType) =>
      EwsUtilities.ValidateEnumVersionValue(
          eventType, this.Service.RequestedServerVersion));
}