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