forked from recurly/recurly-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
recurly.go
58 lines (46 loc) · 1002 Bytes
/
recurly.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
51
52
53
54
55
56
57
58
package recurly
import (
"time"
)
func String(v string) *string {
return &v
}
func Int(v int) *int {
return &v
}
func Float(v float64) *float64 {
return &v
}
func Bool(v bool) *bool {
return &v
}
func Time(v time.Time) *time.Time {
return &v
}
func StringSlice(v []string) []*string {
out := make([]*string, len(v))
for i := range v {
out[i] = &v[i]
}
return out
}
type Empty struct {
recurlyResponse *ResponseMetadata
}
// GetResponse returns the ResponseMetadata that generated this resource
func (resource *Empty) GetResponse() *ResponseMetadata {
return resource.recurlyResponse
}
// setResponse sets the ResponseMetadata that generated this resource
func (resource *Empty) setResponse(res *ResponseMetadata) {
resource.recurlyResponse = res
}
type ListMetadata struct {
ObjectName string `json:"object"`
HasMore bool `json:"has_more"`
Next string `json:"next"`
}
type Resource interface {
GetResponse() *ResponseMetadata
setResponse(*ResponseMetadata)
}