forked from creachadair/twitter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
poll.go
26 lines (20 loc) · 801 Bytes
/
poll.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (C) 2020 Michael J. Fromberger. All Rights Reserved.
package types
import "time"
// A Poll is the encoded description of a Twitter poll.
// The fields marked "default" will always be populated by the API; other
// fields are filled in based on the parameters in the request.
type Poll struct {
ID string `json:"id" twitter:"default"`
Options []*PollOption `json:"options" twitter:"default"`
Duration Minutes `json:"duration_minutes"`
EndTime *time.Time `json:"end_datetime"`
VotingStatus string `json:"voting_status"` // e.g., "closed"
Attachments `json:"attachments"`
}
// A PollOption is a single choice item in a poll.
type PollOption struct {
Position int `json:"position"`
Label string `json:"label"`
Votes int `json:"votes"`
}