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