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