PermissionScheme.fromJson constructor

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

Implementation

factory PermissionScheme.fromJson(Map<String, Object?> json) {
  return PermissionScheme(
    description: json[r'description'] as String?,
    expand: json[r'expand'] as String?,
    id: (json[r'id'] as num?)?.toInt(),
    name: json[r'name'] as String? ?? '',
    permissions: (json[r'permissions'] as List<Object?>?)
            ?.map((i) => PermissionGrant.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    scope: json[r'scope'] != null
        ? Scope.fromJson(json[r'scope']! as Map<String, Object?>)
        : null,
    self: json[r'self'] as String?,
  );
}