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