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