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