ContentCreate.fromJson constructor

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

Implementation

factory ContentCreate.fromJson(Map<String, Object?> json) {
  return ContentCreate(
    id: json[r'id'] as String?,
    title: json[r'title'] as String?,
    type: json[r'type'] as String? ?? '',
    space: json[r'space'] != null
        ? ContentCreateSpace.fromJson(json[r'space']! as Map<String, Object?>)
        : null,
    status: json[r'status'] != null
        ? ContentCreateStatus.fromValue(json[r'status']! as String)
        : null,
    container: json[r'container'] != null
        ? ContentCreateContainer.fromJson(
            json[r'container']! as Map<String, Object?>)
        : null,
    ancestors: (json[r'ancestors'] as List<Object?>?)
            ?.map((i) => ContentCreateAncestorsItem.fromJson(
                i as Map<String, Object?>? ?? const {}))
            .toList() ??
        [],
    body: json[r'body'] != null
        ? ContentCreateBody.fromJson(json[r'body']! as Map<String, Object?>)
        : null,
  );
}