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