toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'_id'] = this.id;
    json[r'tenantId'] = this.tenantId;
  if (this.userId != null) {
    json[r'userId'] = this.userId;
  } else {
    json[r'userId'] = null;
  }
  if (this.anonUserId != null) {
    json[r'anonUserId'] = this.anonUserId;
  } else {
    json[r'anonUserId'] = null;
  }
    json[r'urlId'] = this.urlId;
    json[r'url'] = this.url;
  if (this.pageTitle != null) {
    json[r'pageTitle'] = this.pageTitle;
  } else {
    json[r'pageTitle'] = null;
  }
    json[r'relatedObjectType'] = this.relatedObjectType;
    json[r'relatedObjectId'] = this.relatedObjectId;
    json[r'viewed'] = this.viewed;
    json[r'isUnreadMessage'] = this.isUnreadMessage;
    json[r'sent'] = this.sent;
    json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
    json[r'type'] = this.type;
  if (this.fromCommentId != null) {
    json[r'fromCommentId'] = this.fromCommentId;
  } else {
    json[r'fromCommentId'] = null;
  }
  if (this.fromVoteId != null) {
    json[r'fromVoteId'] = this.fromVoteId;
  } else {
    json[r'fromVoteId'] = null;
  }
  if (this.fromUserName != null) {
    json[r'fromUserName'] = this.fromUserName;
  } else {
    json[r'fromUserName'] = null;
  }
  if (this.fromUserId != null) {
    json[r'fromUserId'] = this.fromUserId;
  } else {
    json[r'fromUserId'] = null;
  }
  if (this.fromUserAvatarSrc != null) {
    json[r'fromUserAvatarSrc'] = this.fromUserAvatarSrc;
  } else {
    json[r'fromUserAvatarSrc'] = null;
  }
    json[r'optedOut'] = this.optedOut;
  if (this.count != null) {
    json[r'count'] = this.count;
  } else {
    json[r'count'] = null;
  }
    json[r'relatedIds'] = this.relatedIds;
    json[r'fromUserIds'] = this.fromUserIds;
    json[r'fromUserNames'] = this.fromUserNames;
  return json;
}