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