strategyFromJson function
Implementation
enums.Strategy strategyFromJson(
Object? strategy, [
enums.Strategy? defaultValue,
]) {
if (strategy is String) {
return enums.$StrategyMap.entries
.firstWhere(
(element) => element.value.toLowerCase() == strategy.toLowerCase(),
orElse: () =>
const MapEntry(enums.Strategy.swaggerGeneratedUnknown, ''))
.key;
}
final parsedResult = defaultValue == null
? null
: enums.$StrategyMap.entries
.firstWhereOrNull((element) => element.value == defaultValue)
?.key;
return parsedResult ?? defaultValue ?? enums.Strategy.swaggerGeneratedUnknown;
}