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