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