toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var author = this.author;
  var body = this.body;
  var created = this.created;
  var id = this.id;
  var jsdAuthorCanSeeRequest = this.jsdAuthorCanSeeRequest;
  var jsdPublic = this.jsdPublic;
  var properties = this.properties;
  var renderedBody = this.renderedBody;
  var self = this.self;
  var updateAuthor = this.updateAuthor;
  var updated = this.updated;
  var visibility = this.visibility;

  final json = <String, Object?>{};
  if (author != null) {
    json[r'author'] = author.toJson();
  }
  if (body != null) {
    json[r'body'] = body;
  }
  if (created != null) {
    json[r'created'] = created.toIso8601String();
  }
  if (id != null) {
    json[r'id'] = id;
  }
  json[r'jsdAuthorCanSeeRequest'] = jsdAuthorCanSeeRequest;
  json[r'jsdPublic'] = jsdPublic;
  json[r'properties'] = properties.map((i) => i.toJson()).toList();
  if (renderedBody != null) {
    json[r'renderedBody'] = renderedBody;
  }
  if (self != null) {
    json[r'self'] = self;
  }
  if (updateAuthor != null) {
    json[r'updateAuthor'] = updateAuthor.toJson();
  }
  if (updated != null) {
    json[r'updated'] = updated.toIso8601String();
  }
  if (visibility != null) {
    json[r'visibility'] = visibility.toJson();
  }
  return json;
}