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