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