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