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