forked from mbeale/gorecurly
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplan_addon_list.go
More file actions
44 lines (39 loc) · 787 Bytes
/
Copy pathplan_addon_list.go
File metadata and controls
44 lines (39 loc) · 787 Bytes
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
package gorecurly
import (
"encoding/xml"
)
//Plan add on list
type PlanAddOnList struct {
Paging
r *Recurly
XMLName xml.Name `xml:"add_ons"`
PlanCode string `xml:"-"`
AddOns []PlanAddOn `xml:"add_on"`
}
//Get next set of Coupons
func (p *PlanAddOnList) Next() bool {
if p.next != "" {
*p, _ = p.r.GetPlanAddOns(p.PlanCode,p.NextParams())
} else {
return false
}
return true
}
//Get previous set of accounts
func (p *PlanAddOnList) Prev() bool {
if p.prev != "" {
*p, _ = p.r.GetPlanAddOns(p.PlanCode,p.PrevParams())
} else {
return false
}
return true
}
//Go to start set of accounts
func (p *PlanAddOnList) Start() bool {
if p.prev != "" {
*p, _ = p.r.GetPlanAddOns(p.PlanCode,p.StartParams())
} else {
return false
}
return true
}