toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  var createdAt = this.createdAt;
  var message = this.message;
  var number = this.number;
  var minorEdit = this.minorEdit;
  var authorId = this.authorId;
  var blogpost = this.blogpost;

  final json = <String, Object?>{};
  if (createdAt != null) {
    json[r'createdAt'] = createdAt.toIso8601String();
  }
  if (message != null) {
    json[r'message'] = message;
  }
  if (number != null) {
    json[r'number'] = number;
  }
  json[r'minorEdit'] = minorEdit;
  if (authorId != null) {
    json[r'authorId'] = authorId;
  }
  if (blogpost != null) {
    json[r'blogpost'] = blogpost.toJson();
  }
  return json;
}