-
Notifications
You must be signed in to change notification settings - Fork 21
/
response.go
38 lines (31 loc) · 883 Bytes
/
response.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
27
28
29
30
31
32
33
34
35
36
37
38
package types
import "github.com/michimani/gotwi/resources"
type ListUsersOutput struct {
Data []resources.User `json:"data"`
Includes struct {
Tweets []resources.Tweet `json:"tweets,omitempty"`
Places []resources.Place `json:"places,omitempty"`
Media []resources.Media `json:"media,omitempty"`
Polls []resources.Poll `json:"polls,omitempty"`
} `json:"includes,omitempty"`
Errors []resources.PartialError `json:"errors,omitempty"`
}
func (r *ListUsersOutput) HasPartialError() bool {
return !(r.Errors == nil || len(r.Errors) == 0)
}
type CreateOutput struct {
Data struct {
Retweeted bool `json:"retweeted"`
} `json:"data"`
}
func (r *CreateOutput) HasPartialError() bool {
return false
}
type DeleteOutput struct {
Data struct {
Retweeted bool `json:"retweeted"`
} `json:"data"`
}
func (r *DeleteOutput) HasPartialError() bool {
return false
}