NotificationRecipientsRestrictions.fromJson constructor

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

Implementation

factory NotificationRecipientsRestrictions.fromJson(
    Map<String, Object?> json) {
  return NotificationRecipientsRestrictions(
    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() ??
        [],
    permissions: (json[r'permissions'] as List<Object?>?)
            ?.map((i) => RestrictedPermission.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}