summaryrefslogtreecommitdiff
path: root/internal/api/model/poll.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/model/poll.go')
-rw-r--r--internal/api/model/poll.go27
1 files changed, 16 insertions, 11 deletions
diff --git a/internal/api/model/poll.go b/internal/api/model/poll.go
index c6bffbe29..a925be8fd 100644
--- a/internal/api/model/poll.go
+++ b/internal/api/model/poll.go
@@ -51,19 +51,24 @@ type Poll struct {
type PollOptions struct {
// The text value of the poll option. String.
Title string `json:"title"`
- // The number of received votes for this option. Number, or null if results are not published yet.
+ // The number of received votes for this option.
+ // Number, or null if results are not published yet.
VotesCount int `json:"votes_count,omitempty"`
}
-// PollRequest represents a mastodon-api poll attached to a status POST request, as defined here: https://docs.joinmastodon.org/methods/statuses/
-// It should be used at the path https://example.org/api/v1/statuses
+// PollRequest models a request to create a poll.
+//
+// swagger:parameters createStatus
type PollRequest struct {
- // Array of possible answers. If provided, media_ids cannot be used, and poll[expires_in] must be provided.
- Options []string `form:"options"`
- // Duration the poll should be open, in seconds. If provided, media_ids cannot be used, and poll[options] must be provided.
- ExpiresIn int `form:"expires_in"`
- // Allow multiple choices?
- Multiple bool `form:"multiple"`
- // Hide vote counts until the poll ends?
- HideTotals bool `form:"hide_totals"`
+ // Array of possible answers.
+ // If provided, media_ids cannot be used, and poll[expires_in] must be provided.
+ // name: poll[options]
+ Options []string `form:"options" json:"options" xml:"options"`
+ // Duration the poll should be open, in seconds.
+ // If provided, media_ids cannot be used, and poll[options] must be provided.
+ ExpiresIn int `form:"expires_in" json:"expires_in" xml:"expires_in"`
+ // Allow multiple choices on this poll.
+ Multiple bool `form:"multiple" json:"multiple" xml:"multiple"`
+ // Hide vote counts until the poll ends.
+ HideTotals bool `form:"hide_totals" json:"hide_totals" xml:"hide_totals"`
}