toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var content = this.content;
  var user = this.user;
  var space = this.space;
  var title = this.title;
  var excerpt = this.excerpt;
  var url = this.url;
  var resultParentContainer = this.resultParentContainer;
  var resultGlobalContainer = this.resultGlobalContainer;
  var breadcrumbs = this.breadcrumbs;
  var entityType = this.entityType;
  var iconCssClass = this.iconCssClass;
  var lastModified = this.lastModified;
  var friendlyLastModified = this.friendlyLastModified;
  var score = this.score;

  final json = <String, Object?>{};
  if (content != null) {
    json[r'content'] = content.toJson();
  }
  if (user != null) {
    json[r'user'] = user.toJson();
  }
  if (space != null) {
    json[r'space'] = space.toJson();
  }
  json[r'title'] = title;
  json[r'excerpt'] = excerpt;
  json[r'url'] = url;
  if (resultParentContainer != null) {
    json[r'resultParentContainer'] = resultParentContainer.toJson();
  }
  if (resultGlobalContainer != null) {
    json[r'resultGlobalContainer'] = resultGlobalContainer.toJson();
  }
  json[r'breadcrumbs'] = breadcrumbs.map((i) => i.toJson()).toList();
  json[r'entityType'] = entityType;
  json[r'iconCssClass'] = iconCssClass;
  json[r'lastModified'] = lastModified.toIso8601String();
  if (friendlyLastModified != null) {
    json[r'friendlyLastModified'] = friendlyLastModified;
  }
  if (score != null) {
    json[r'score'] = score;
  }
  return json;
}