ContentBlueprintDraft.fromJson constructor

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

Implementation

factory ContentBlueprintDraft.fromJson(Map<String, Object?> json) {
  return ContentBlueprintDraft(
    version: ContentBlueprintDraftVersion.fromJson(
        json[r'version'] as Map<String, Object?>? ?? const {}),
    title: json[r'title'] as String? ?? '',
    type: ContentBlueprintDraftType.fromValue(json[r'type'] as String? ?? ''),
    status: json[r'status'] != null
        ? ContentBlueprintDraftStatus.fromValue(json[r'status']! as String)
        : null,
    space: json[r'space'] != null
        ? ContentBlueprintDraftSpace.fromJson(
            json[r'space']! as Map<String, Object?>)
        : null,
    ancestors: (json[r'ancestors'] as List<Object?>?)
            ?.map((i) => ContentBlueprintDraftAncestorsItem.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
  );
}