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