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