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