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