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