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