PermissionCheckResponse.fromJson constructor

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

Implementation

factory PermissionCheckResponse.fromJson(Map<String, Object?> json) {
  return PermissionCheckResponse(
    hasPermission: json[r'hasPermission'] as bool? ?? false,
    errors: (json[r'errors'] as List<Object?>?)
            ?.map((i) =>
                Message.fromJson(i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    links: json[r'_links'] != null
        ? GenericLinks.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
  );
}