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