Validate method

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

Implementation

@override
void Validate() {
  super.Validate();
  EwsUtilities.ValidateParam(PropertySet, "PropertySet");
  EwsUtilities.ValidateParam(SyncFolderId, "SyncFolderId");
  SyncFolderId!.ValidateExchangeVersion(Service.RequestedServerVersion);

  // SyncFolderItemsScope enum was introduced with Exchange2010.  Only
  // value NormalItems is valid with previous server versions.
  if (Service.RequestedServerVersion.index <
          ExchangeVersion.Exchange2010.index &&
      _syncScope != SyncFolderItemsScope.NormalItems) {
    throw ServiceVersionException("""string.Format(
                                Strings.EnumValueIncompatibleWithRequestVersion,
                                this.syncScope.ToString(),
                                this.syncScope.GetType().Name,
                                ExchangeVersion.Exchange2010)""");
  }

  // NumberOfDays was introduced with Exchange 2013.
  if (Service.RequestedServerVersion.index <
          ExchangeVersion.Exchange2013.index &&
      NumberOfDays != 0) {
    throw ServiceVersionException("""string.Format(
                                Strings.ParameterIncompatibleWithRequestVersion,
                                "numberOfDays",
                                ExchangeVersion.Exchange2013)""");
  }

  // SyncFolderItems can only handle summary properties
  PropertySet!.ValidateForRequest(this, true /*summaryPropertiesOnly*/);
}