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