ValidateEnumVersionValue static method

void ValidateEnumVersionValue(
  1. dynamic enumValue,
  2. ExchangeVersion requestVersion
)
Validates the enum value against the request version. The enum value. The request version.

Implementation

static void ValidateEnumVersionValue(
    dynamic enumValue, ExchangeVersion requestVersion) {
  Type enumType = enumValue.runtimeType;
  Map<dynamic, ExchangeVersion?> enumVersionDict =
      enumVersionDictionaries.Member![enumType]!;
  ExchangeVersion enumVersion = enumVersionDict[enumValue]!;
  if (requestVersion.index < enumVersion.index) {
    throw new ServiceVersionException(
        """Strings.EnumValueIncompatibleWithRequestVersion,
                                $enumValue,
                                $enumType,
                                $enumVersion""");
  }
}