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