Poll

@Immutable
data class Poll(val id: String, val name: String, val description: String, val options: List<Option>, val votingVisibility: VotingVisibility, val enforceUniqueVote: Boolean, val maxVotesAllowed: Int, val allowUserSuggestedOptions: Boolean, val allowAnswers: Boolean, val voteCountsByOption: Map<String, Int>, val votes: List<Vote>, val ownVotes: List<Vote>, val createdAt: Date, val updatedAt: Date, val closed: Boolean)

The Poll object represents a poll in a channel.

Constructors

Link copied to clipboard
constructor(id: String, name: String, description: String, options: List<Option>, votingVisibility: VotingVisibility, enforceUniqueVote: Boolean, maxVotesAllowed: Int, allowUserSuggestedOptions: Boolean, allowAnswers: Boolean, voteCountsByOption: Map<String, Int>, votes: List<Vote>, ownVotes: List<Vote>, createdAt: Date, updatedAt: Date, closed: Boolean)

Properties

Link copied to clipboard

If set to true, users can vote.

Link copied to clipboard

If set to true, users can suggest new options.

Link copied to clipboard

If set to true, the poll is closed and no more votes can be cast.

Link copied to clipboard

The creation date of the poll.

Link copied to clipboard

The description of the poll.

Link copied to clipboard

If set to true, a user can only vote once.

Link copied to clipboard
val id: String

The unique identifier of the poll.

Link copied to clipboard

The maximum number of votes a user can cast.

Link copied to clipboard

The name of the poll.

Link copied to clipboard

The list of options for the poll.

Link copied to clipboard

The list of votes cast by the current user.

Link copied to clipboard

The last update date of the poll.

Link copied to clipboard

The number of votes for each option.

Link copied to clipboard

The list of votes.

Link copied to clipboard

The visibility of the votes. If set to VotingVisibility.ANONYMOUS, the votes will be anonymous.

Functions

Link copied to clipboard
fun getVotes(option: Option): List<Vote>

Get the votes for a specific option.