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