ContentHistory.fromJson constructor

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

Implementation

factory ContentHistory.fromJson(Map<String, Object?> json) {
  return ContentHistory(
    latest: json[r'latest'] as bool? ?? false,
    createdBy: json[r'createdBy'] != null
        ? User.fromJson(json[r'createdBy']! as Map<String, Object?>)
        : null,
    ownedBy: json[r'ownedBy'] != null
        ? User.fromJson(json[r'ownedBy']! as Map<String, Object?>)
        : null,
    lastOwnedBy: json[r'lastOwnedBy'] != null
        ? User.fromJson(json[r'lastOwnedBy']! as Map<String, Object?>)
        : null,
    createdDate: DateTime.tryParse(json[r'createdDate'] as String? ?? ''),
    lastUpdated: json[r'lastUpdated'] != null
        ? Version.fromJson(json[r'lastUpdated']! as Map<String, Object?>)
        : null,
    previousVersion: json[r'previousVersion'] != null
        ? Version.fromJson(json[r'previousVersion']! as Map<String, Object?>)
        : null,
    contributors: json[r'contributors'] != null
        ? ContentHistoryContributors.fromJson(
            json[r'contributors']! as Map<String, Object?>)
        : null,
    nextVersion: json[r'nextVersion'] != null
        ? Version.fromJson(json[r'nextVersion']! as Map<String, Object?>)
        : null,
    expandable: json[r'_expandable'] != null
        ? ContentHistoryExpandable.fromJson(
            json[r'_expandable']! as Map<String, Object?>)
        : null,
    links: json[r'_links'] != null
        ? GenericLinks.fromJson(json[r'_links']! as Map<String, Object?>)
        : null,
  );
}