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