ProjectRole.fromJson constructor

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

Implementation

factory ProjectRole.fromJson(Map<String, Object?> json) {
  return ProjectRole(
    actors: (json[r'actors'] as List<Object?>?)
            ?.map((i) =>
                RoleActor.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    admin: json[r'admin'] as bool? ?? false,
    currentUserRole: json[r'currentUserRole'] as bool? ?? false,
    default$: json[r'default'] as bool? ?? false,
    description: json[r'description'] as String?,
    id: (json[r'id'] as num?)?.toInt(),
    name: json[r'name'] as String?,
    roleConfigurable: json[r'roleConfigurable'] as bool? ?? false,
    scope: json[r'scope'] != null
        ? Scope.fromJson(json[r'scope']! as Map<String, Object?>)
        : null,
    self: json[r'self'] as String?,
    translatedName: json[r'translatedName'] as String?,
  );
}