summaryrefslogtreecommitdiff
path: root/internal/api/model/poll.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-08-02 19:06:44 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-02 19:06:44 +0200
commit0386a28b5a3c4212320e8a96ddd14c54b65a2090 (patch)
tree3bfdf198934215ac64acac9d66d952baf65c2752 /internal/api/model/poll.go
parentfix breaky linky (diff)
downloadgotosocial-0386a28b5a3c4212320e8a96ddd14c54b65a2090.tar.xz
Frodo swaggins (#126)
* more swagger fun * document a whole bunch more stuff * more swagger yayyyyyyy * progress + go fmt
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"`
}