toJson method

Map<String, dynamic> toJson()
override

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['owner_id'] = this.ownerId;
  data['plurk_id'] = this.plurkId;
  data['user_id'] = this.userId;
  data['posted'] = this.posted;
  data['replurker_id'] = this.replurkerId;
  data['qualifier'] = this.qualifier;
  data['content'] = this.content;
  data['content_raw'] = this.contentRaw;
  data['lang'] = this.lang;
  data['response_count'] = this.responseCount;
  data['responses_seen'] = this.responsesSeen;
  data['limited_to'] = this.limitedTo;
  data['excluded'] = this.excluded;

  switch (noComments) {
    case Comment.Allow:
      data['no_comments'] = 0;
      break;
    case Comment.DisableComment:
      data['no_comments'] = 1;
      break;
    case Comment.FriendsOnly:
      data['no_comments'] = 2;
      break;
    case null:
      break;
  }

  data['plurk_type'] = this.plurkType;
  data['is_unread'] = this.isUnread;
  data['last_edited'] = this.lastEdited;
  data['porn'] = this.porn;
  data['publish_to_followers'] = this.publishToFollowers;
  data['coins'] = this.coins;
  data['has_gift'] = this.hasGift;
  if (this.favorers != null) {
    data['favorers'] = this.favorers!.map((v) => v).toList();
  }
  data['favorite_count'] = this.favoriteCount;
  data['replurked'] = this.replurked;
  if (this.replurkers != null) {
    data['replurkers'] = this.replurkers!.map((v) => v).toList();
  }
  data['replurkers_count'] = this.replurkersCount;
  data['replurkable'] = this.replurkable;
  data['anonymous'] = this.anonymous;
  data['responded'] = this.responded;
  data['mentioned'] = this.mentioned;
  data['favorite'] = this.favorite;
  data['bookmark'] = this.bookmark;
  data['qualifier_translated'] = this.qualifierTranslated;
  data['error_text'] = this.errorText;
  data['success_text'] = this.successText;

  data['type'] = this.type;
  return data;
}