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