toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var author = this.author;
  var created = this.created;
  var historyMetadata = this.historyMetadata;
  var id = this.id;
  var items = this.items;

  final json = <String, Object?>{};
  if (author != null) {
    json[r'author'] = author.toJson();
  }
  if (created != null) {
    json[r'created'] = created.toIso8601String();
  }
  if (historyMetadata != null) {
    json[r'historyMetadata'] = historyMetadata.toJson();
  }
  if (id != null) {
    json[r'id'] = id;
  }
  json[r'items'] = items.map((i) => i.toJson()).toList();
  return json;
}