NotificationRecipients.fromJson constructor

NotificationRecipients.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory NotificationRecipients.fromJson(Map<String, Object?> json) {
  return NotificationRecipients(
    assignee: json[r'assignee'] as bool? ?? false,
    groupIds: (json[r'groupIds'] as List<Object?>?)
            ?.map((i) => i as String? ?? '')
            .toList() ??
        [],
    groups: (json[r'groups'] as List<Object?>?)
            ?.map((i) =>
                GroupName.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    reporter: json[r'reporter'] as bool? ?? false,
    users: (json[r'users'] as List<Object?>?)
            ?.map((i) =>
                UserDetails.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    voters: json[r'voters'] as bool? ?? false,
    watchers: json[r'watchers'] as bool? ?? false,
  );
}