-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
response.go
50 lines (41 loc) · 1.19 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
package types
import "github.com/michimani/gotwi/resources"
type ListFollowingsOutput struct {
Data []resources.User `json:"data"`
Meta resources.PaginationMeta `json:"meta"`
Includes struct {
Tweets []resources.Tweet `json:"tweets"`
} `json:"includes"`
Errors []resources.PartialError `json:"errors"`
}
func (r *ListFollowingsOutput) HasPartialError() bool {
return !(r.Errors == nil || len(r.Errors) == 0)
}
type ListFollowersOutput struct {
Data []resources.User `json:"data"`
Meta resources.PaginationMeta `json:"meta"`
Includes struct {
Tweets []resources.Tweet `json:"tweets"`
} `json:"includes"`
Errors []resources.PartialError `json:"errors"`
}
func (r *ListFollowersOutput) HasPartialError() bool {
return !(r.Errors == nil || len(r.Errors) == 0)
}
type CreateFollowingOutput struct {
Data struct {
Following bool `json:"following"`
PendingFollow bool `json:"pending_follow"`
} `json:"data"`
}
func (r *CreateFollowingOutput) HasPartialError() bool {
return false
}
type DeleteFollowingOutput struct {
Data struct {
Following bool `json:"following"`
} `json:"data"`
}
func (r *DeleteFollowingOutput) HasPartialError() bool {
return false
}