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