toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var id = this.id;
  var type = this.type;
  var status = this.status;
  var title = this.title;
  var space = this.space;
  var history = this.history;
  var version = this.version;
  var ancestors = this.ancestors;
  var operations = this.operations;
  var children = this.children;
  var childTypes = this.childTypes;
  var descendants = this.descendants;
  var container = this.container;
  var body = this.body;
  var restrictions = this.restrictions;
  var metadata = this.metadata;
  var macroRenderedOutput = this.macroRenderedOutput;
  var extensions = this.extensions;
  var expandable = this.expandable;
  var links = this.links;

  final json = <String, Object?>{};
  if (id != null) {
    json[r'id'] = id;
  }
  json[r'type'] = type;
  json[r'status'] = status;
  if (title != null) {
    json[r'title'] = title;
  }
  if (space != null) {
    json[r'space'] = space.toJson();
  }
  if (history != null) {
    json[r'history'] = history.toJson();
  }
  if (version != null) {
    json[r'version'] = version.toJson();
  }
  json[r'ancestors'] = ancestors.map((i) => i.toJson()).toList();
  json[r'operations'] = operations.map((i) => i.toJson()).toList();
  if (children != null) {
    json[r'children'] = children.toJson();
  }
  if (childTypes != null) {
    json[r'childTypes'] = childTypes.toJson();
  }
  if (descendants != null) {
    json[r'descendants'] = descendants.toJson();
  }
  if (container != null) {
    json[r'container'] = container.toJson();
  }
  if (body != null) {
    json[r'body'] = body.toJson();
  }
  if (restrictions != null) {
    json[r'restrictions'] = restrictions.toJson();
  }
  if (metadata != null) {
    json[r'metadata'] = metadata.toJson();
  }
  if (macroRenderedOutput != null) {
    json[r'macroRenderedOutput'] = macroRenderedOutput;
  }
  if (extensions != null) {
    json[r'extensions'] = extensions;
  }
  if (expandable != null) {
    json[r'_expandable'] = expandable.toJson();
  }
  if (links != null) {
    json[r'_links'] = links.toJson();
  }
  return json;
}