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