ContentUpdate.fromJson constructor

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

Implementation

factory ContentUpdate.fromJson(Map<String, Object?> json) {
  return ContentUpdate(
    version: ContentUpdateVersion.fromJson(
        json[r'version'] as Map<String, Object?>? ?? const {}),
    title: json[r'title'] as String?,
    type: json[r'type'] as String? ?? '',
    status: json[r'status'] != null
        ? ContentUpdateStatus.fromValue(json[r'status']! as String)
        : null,
    ancestors: (json[r'ancestors'] as List<Object?>?)
            ?.map((i) => ContentUpdateAncestorsItem.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    body: json[r'body'] != null
        ? ContentUpdateBody.fromJson(json[r'body']! as Map<String, Object?>)
        : null,
  );
}