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