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