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