-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
response.go
39 lines (32 loc) · 913 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
39
package types
import "github.com/michimani/gotwi/resources"
type ListOutput struct {
Data []resources.Tweet `json:"data"`
Meta resources.PaginationMeta
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 *ListOutput) HasPartialError() bool {
return !(r.Errors == nil || len(r.Errors) == 0)
}
type CreateOutput struct {
Data struct {
Bookmarked bool `json:"bookmarked"`
} `json:"data"`
}
func (r *CreateOutput) HasPartialError() bool {
return false
}
type DeleteOutput struct {
Data struct {
Bookmarked bool `json:"bookmarked"`
} `json:"data"`
}
func (r *DeleteOutput) HasPartialError() bool {
return false
}