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