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