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