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