PageSingle.fromJson constructor

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

Implementation

factory PageSingle.fromJson(Map<String, Object?> json) {
  return PageSingle(
    id: json[r'id'],
    status: json[r'status'] as String?,
    title: json[r'title'] as String?,
    spaceId: json[r'spaceId'],
    parentId: json[r'parentId'],
    parentType: json[r'parentType'] as String?,
    position: (json[r'position'] as num?)?.toInt(),
    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
        ? BodySingle.fromJson(json[r'body']! as Map<String, Object?>)
        : null,
    links: json[r'_links'] != null
        ? AbstractPageLinks.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
  );
}