forked from blacklightcms/recurly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_ons.go
52 lines (39 loc) · 1.57 KB
/
add_ons.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
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.AddOnsService = &AddOnsService{}
// AddOnsService manages the interactions for add ons.
type AddOnsService struct {
OnList func(planCode string, opts *recurly.PagerOptions) recurly.Pager
ListInvoked bool
OnGet func(ctx context.Context, planCode string, code string) (*recurly.AddOn, error)
GetInvoked bool
OnCreate func(ctx context.Context, planCode string, a recurly.AddOn) (*recurly.AddOn, error)
CreateInvoked bool
OnUpdate func(ctx context.Context, planCode string, code string, a recurly.AddOn) (*recurly.AddOn, error)
UpdateInvoked bool
OnDelete func(ctx context.Context, planCode string, code string) error
DeleteInvoked bool
}
func (m *AddOnsService) List(planCode string, opts *recurly.PagerOptions) recurly.Pager {
m.ListInvoked = true
return m.OnList(planCode, opts)
}
func (m *AddOnsService) Get(ctx context.Context, planCode string, code string) (*recurly.AddOn, error) {
m.GetInvoked = true
return m.OnGet(ctx, planCode, code)
}
func (m *AddOnsService) Create(ctx context.Context, planCode string, a recurly.AddOn) (*recurly.AddOn, error) {
m.CreateInvoked = true
return m.OnCreate(ctx, planCode, a)
}
func (m *AddOnsService) Update(ctx context.Context, planCode string, code string, a recurly.AddOn) (*recurly.AddOn, error) {
m.UpdateInvoked = true
return m.OnUpdate(ctx, planCode, code, a)
}
func (m *AddOnsService) Delete(ctx context.Context, planCode string, code string) error {
m.DeleteInvoked = true
return m.OnDelete(ctx, planCode, code)
}