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