toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'Custom'] = this.custom;
    json[r'allow_answers'] = this.allowAnswers;
    json[r'allow_user_suggested_options'] = this.allowUserSuggestedOptions;
    json[r'answers_count'] = this.answersCount;
    json[r'created_at'] = this.createdAt.toUtc().toIso8601String();
  if (this.createdBy != null) {
    json[r'created_by'] = this.createdBy;
  } else {
    json[r'created_by'] = null;
  }
    json[r'created_by_id'] = this.createdById;
    json[r'description'] = this.description;
    json[r'enforce_unique_vote'] = this.enforceUniqueVote;
    json[r'id'] = this.id;
  if (this.isClosed != null) {
    json[r'is_closed'] = this.isClosed;
  } else {
    json[r'is_closed'] = null;
  }
    json[r'latest_answers'] = this.latestAnswers;
    json[r'latest_votes_by_option'] = this.latestVotesByOption;
  if (this.maxVotesAllowed != null) {
    json[r'max_votes_allowed'] = this.maxVotesAllowed;
  } else {
    json[r'max_votes_allowed'] = null;
  }
    json[r'name'] = this.name;
    json[r'options'] = this.options;
    json[r'own_votes'] = this.ownVotes;
    json[r'updated_at'] = this.updatedAt.toUtc().toIso8601String();
    json[r'vote_count'] = this.voteCount;
    json[r'vote_counts_by_option'] = this.voteCountsByOption;
  if (this.votingVisibility != null) {
    json[r'voting_visibility'] = this.votingVisibility;
  } else {
    json[r'voting_visibility'] = null;
  }
  return json;
}