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