CustomContentSingle.fromJson constructor

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

Implementation

factory CustomContentSingle.fromJson(Map<String, Object?> json) {
  return CustomContentSingle(
    id: json[r'id'] as String?,
    type: json[r'type'] as String?,
    status: json[r'status'] as String?,
    title: json[r'title'] as String?,
    spaceId: json[r'spaceId'] as String?,
    pageId: json[r'pageId'] as String?,
    blogPostId: json[r'blogPostId'] as String?,
    customContentId: json[r'customContentId'] as String?,
    authorId: json[r'authorId'] as String?,
    createdAt: DateTime.tryParse(json[r'createdAt'] as String? ?? ''),
    version: json[r'version'] != null
        ? Version.fromJson(json[r'version']! as Map<String, Object?>)
        : null,
    body: json[r'body'] != null
        ? CustomContentBodySingle.fromJson(
            json[r'body']! as Map<String, Object?>)
        : null,
    links: json[r'_links'] != null
        ? CustomContentLinks.fromJson(
            json[r'_links']! as Map<String, Object?>)
        : null,
  );
}