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