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