-
Notifications
You must be signed in to change notification settings - Fork 45
/
accounts.go
76 lines (57 loc) · 2.11 KB
/
accounts.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package mock
import (
"context"
"github.com/blacklightcms/recurly"
)
var _ recurly.AccountsService = &AccountsService{}
// AccountsService manages the interactions for accounts.
type AccountsService struct {
OnList func(opts *recurly.PagerOptions) recurly.Pager
ListInvoked bool
OnGet func(ctx context.Context, code string) (*recurly.Account, error)
GetInvoked bool
OnBalance func(ctx context.Context, code string) (*recurly.AccountBalance, error)
BalanceInvoked bool
OnCreate func(ctx context.Context, a recurly.Account) (*recurly.Account, error)
CreateInvoked bool
OnUpdate func(ctx context.Context, code string, a recurly.Account) (*recurly.Account, error)
UpdateInvoked bool
OnClose func(ctx context.Context, code string) error
CloseInvoked bool
OnReopen func(ctx context.Context, code string) error
ReopenInvoked bool
OnListNotes func(code string, opts *recurly.PagerOptions) recurly.Pager
ListNotesInvoked bool
}
func (m *AccountsService) List(opts *recurly.PagerOptions) recurly.Pager {
m.ListInvoked = true
return m.OnList(opts)
}
func (m *AccountsService) Get(ctx context.Context, code string) (*recurly.Account, error) {
m.GetInvoked = true
return m.OnGet(ctx, code)
}
func (m *AccountsService) Balance(ctx context.Context, code string) (*recurly.AccountBalance, error) {
m.BalanceInvoked = true
return m.OnBalance(ctx, code)
}
func (m *AccountsService) Create(ctx context.Context, a recurly.Account) (*recurly.Account, error) {
m.CreateInvoked = true
return m.OnCreate(ctx, a)
}
func (m *AccountsService) Update(ctx context.Context, code string, a recurly.Account) (*recurly.Account, error) {
m.UpdateInvoked = true
return m.OnUpdate(ctx, code, a)
}
func (m *AccountsService) Close(ctx context.Context, code string) error {
m.CloseInvoked = true
return m.OnClose(ctx, code)
}
func (m *AccountsService) Reopen(ctx context.Context, code string) error {
m.ReopenInvoked = true
return m.OnReopen(ctx, code)
}
func (m *AccountsService) ListNotes(code string, opts *recurly.PagerOptions) recurly.Pager {
m.ListNotesInvoked = true
return m.OnListNotes(code, opts)
}