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