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