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